Skip to content

Commit

Permalink
MDL-54722 javascript: Add YUI depend wrapper to global event
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jun 2, 2016
1 parent a5ea514 commit 0526330
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion blocks/navigation/amd/build/navblock.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions blocks/navigation/amd/src/navblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ define(['jquery', 'core/tree'], function($, Tree) {
var navTree = new Tree(".block_navigation .block_tree");
navTree.finishExpandingGroup = function(item) {
Tree.prototype.finishExpandingGroup.call(this, item);
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
Y.use('moodle-core-event', function() {
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
});
});
};
navTree.collapseGroup = function(item) {
Tree.prototype.collapseGroup.call(this, item);
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
Y.use('moodle-core-event', function() {
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
});
});
};
}
Expand Down
2 changes: 1 addition & 1 deletion blocks/settings/amd/build/settingsblock.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions blocks/settings/amd/src/settingsblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ define(['jquery', 'core/tree'], function($, Tree) {
}
adminTree.finishExpandingGroup = function(item) {
Tree.prototype.finishExpandingGroup.call(this, item);
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
Y.use('moodle-core-event', function() {
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
});
});
};
adminTree.collapseGroup = function(item) {
Tree.prototype.collapseGroup.call(this, item);
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
});
Y.use('moodle-core-event', function() {
Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED, {
instanceid: instanceid
});
});
};
}
};
Expand Down

0 comments on commit 0526330

Please sign in to comment.