MDL-54722 javascript: Add YUI depend wrapper to global event

This commit is contained in:
Andrew Nicols 2016-06-02 10:07:52 +08:00
parent a5ea5149b8
commit 05263307d7
4 changed files with 19 additions and 8 deletions

View File

@ -1 +1 @@
define(["jquery","core/tree"],function(a,b){return{init:function(a){var c=new b(".block_navigation .block_tree");c.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c),Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})},c.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c),Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})}}}});
define(["jquery","core/tree"],function(a,b){return{init:function(a){var c=new b(".block_navigation .block_tree");c.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})},c.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})}}}});

View File

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

View File

@ -1 +1 @@
define(["jquery","core/tree"],function(a,b){return{init:function(a,c){var d=new b(".block_settings .block_tree");if(c){var e=d.treeRoot.find("#"+c),f=e.children("a").first();f.replaceWith('<span tabindex="0">'+f.html()+"</span>")}d.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c),Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})},d.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c),Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})}}}});
define(["jquery","core/tree"],function(a,b){return{init:function(a,c){var d=new b(".block_settings .block_tree");if(c){var e=d.treeRoot.find("#"+c),f=e.children("a").first();f.replaceWith('<span tabindex="0">'+f.html()+"</span>")}d.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})},d.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c),Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a}),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})}}}});

View File

@ -32,8 +32,10 @@ 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) {
@ -41,6 +43,11 @@ define(['jquery', 'core/tree'], function($, Tree) {
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
});
});
};
}
};