Skip to content

Commit

Permalink
[BUGFIX beta] data-ember-action no longer has a value
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinJoyce committed Jan 24, 2017
1 parent e0ce3f7 commit 4f9dcfb
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions packages/ember-views/lib/system/event_dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,26 +218,16 @@ export default EmberObject.extend({
});

rootElement.on(`${event}.ember`, '[data-ember-action]', evt => {
let actionId = jQuery(evt.currentTarget).attr('data-ember-action');
let actions = ActionManager.registeredActions[actionId];

// In Glimmer2 this attribute is set to an empty string and an additional
// attribute it set for each action on a given element. In this case, the
// attributes need to be read so that a proper set of action handlers can
// be coalesced.
if (actionId === '') {
let attributes = evt.currentTarget.attributes;
let attributeCount = attributes.length;

actions = [];

for (let i = 0; i < attributeCount; i++) {
let attr = attributes.item(i);
let attrName = attr.name;

if (attrName.indexOf('data-ember-action-') === 0) {
actions = actions.concat(ActionManager.registeredActions[attr.value]);
}
let attributes = evt.currentTarget.attributes;
let attributeCount = attributes.length;
let actions = [];

for (let i = 0; i < attributeCount; i++) {
let attr = attributes.item(i);
let attrName = attr.name;

if (attrName.indexOf('data-ember-action-') === 0) {
actions = actions.concat(ActionManager.registeredActions[attr.value]);
}
}

Expand Down

0 comments on commit 4f9dcfb

Please sign in to comment.