Rename elId to id

This commit is contained in:
Patrick Steele-Idem 2014-07-28 15:47:45 -06:00
parent 37cdd6b5d8
commit b8961b8a0a
2 changed files with 7 additions and 7 deletions

View File

@ -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,

View File

@ -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()}');
}