mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Rename elId to id
This commit is contained in:
parent
37cdd6b5d8
commit
b8961b8a0a
@ -8,7 +8,7 @@ module.exports = function render(input, context) {
|
||||
var modulePath = input.module;
|
||||
var config = input.config || input._cfg;
|
||||
var widgetArgs = context.attributes.widgetArgs;
|
||||
var elId = input.elId;
|
||||
var id = input.id;
|
||||
var scope = input.scope || context.getAttribute('widget');
|
||||
var assignedId = input.assignedId;
|
||||
var events;
|
||||
@ -18,7 +18,7 @@ module.exports = function render(input, context) {
|
||||
assignedId = assignedId || widgetArgs.id;
|
||||
events = widgetArgs.events;
|
||||
}
|
||||
if (!elId && input.hasOwnProperty('elId')) {
|
||||
if (!id && input.hasOwnProperty('id')) {
|
||||
throw new Error('Invalid widget ID for "' + modulePath + '"');
|
||||
}
|
||||
var widgetsContext = widgets.getWidgetsContext(context);
|
||||
@ -27,7 +27,7 @@ module.exports = function render(input, context) {
|
||||
|
||||
var widgetDef = widgetsContext.beginWidget({
|
||||
module: modulePath,
|
||||
id: elId,
|
||||
id: id,
|
||||
assignedId: assignedId,
|
||||
config: config,
|
||||
scope: scope,
|
||||
|
||||
@ -135,10 +135,10 @@ exports.process =function (node, compiler, template) {
|
||||
if (scope) {
|
||||
widgetNode.setProperty('scope', scope);
|
||||
}
|
||||
var elId = node.getAttribute('id');
|
||||
if (elId) {
|
||||
elId = compiler.convertType(elId, 'string', true);
|
||||
widgetNode.setProperty('elId', elId);
|
||||
var id = node.getAttribute('id');
|
||||
if (id) {
|
||||
id = compiler.convertType(id, 'string', true);
|
||||
widgetNode.setProperty('id', id);
|
||||
} else {
|
||||
node.setAttribute('id', '${widget.elId()}');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user