Skip to content

Instantly share code, notes, and snippets.

@bmbrands
Created October 17, 2013 13:21
Show Gist options
  • Save bmbrands/7024806 to your computer and use it in GitHub Desktop.
Save bmbrands/7024806 to your computer and use it in GitHub Desktop.
YUI.add('moodle-theme_surf-yuimodal', function(Y) {
var yuimodal = 'yuimodal panel';
var panel = new Y.Panel({
srcNode: '#panelContent',
width : 600,
xy : [300, 0],
zIndex : 6,
modal : true,
visible: false,
render : true,
});
var yuimodal = function() {
yuimodal.superclass.constructor.apply(this, arguments);
};
// Make the colour switcher a fully fledged YUI module
Y.extend(yuimodal, Y.Base, {
initializer : function(config) {
console.log('init yuimodal');
Y.all('.pagemodal').each(function(modal){
var target = modal.getAttribute('pageid');
var url = M.cfg.wwwroot+'/mod/page/view.php?id=/'+target;
modal.on("click", this.showme(), this);
});
},
showme : function (e) {
console.log('url' + this.url);
}
}, {
NAME : 'surf yui modal',
ATTRS : {
}
});
// Our leaf theme namespace
M.theme_surf = M.theme_surf || {};
// Initialisation function for the colour switcher
M.theme_surf.inityuimodal = function(cfg) {
return new yuimodal(cfg);
}
}, '@VERSION@', {requires:['panel','node,','node-load','attribute', 'event']});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment