mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-50308 tool_lp: Big javascript cleanup
This includes: * Move all JS modules from lib/amd to admin/tool/lp/amd * Add all jsdocs * fix all jshint warnings * Rewrite the actionmenu wrapper to a real amd module
This commit is contained in:
parent
d629323f72
commit
7e8d4dac9b
41 changed files with 1805 additions and 398 deletions
1
lib/amd/build/dragdrop-reorder.min.js
vendored
1
lib/amd/build/dragdrop-reorder.min.js
vendored
|
@ -1 +0,0 @@
|
|||
define(["core/str","core/yui"],function(a,b){var c=function(a){var b=a.drag.get("node"),c=a.drop.get("node");this.callback(b.getDOMNode(),c.getDOMNode())};return{dragdrop:function(d,e,f,g,h,i,j,k){a.get_strings([{key:"emptydragdropregion",component:"moodle"},{key:"movecontent",component:"moodle"},{key:"tocontent",component:"moodle"}]).done(function(){b.use("moodle-core-dragdrop-reorder",function(){var a={callback:k};M.core.dragdrop_reorder({group:d,dragHandleText:e,sameNodeText:f,parentNodeText:g,sameNodeClass:h,parentNodeClass:i,dragHandleInsertClass:j,callback:b.bind(c,a)})})})}}});
|
1
lib/amd/build/menu.min.js
vendored
1
lib/amd/build/menu.min.js
vendored
|
@ -1 +0,0 @@
|
|||
define(["jquery","core/templates","core/notification","core/yui"],function(a,b,c,d){var e=function(b){var c=a(b);c.find("li a").each(function(b,c){a(c).addClass("menu-action"),a(c).attr("role","menuitem")}),a(this).replaceWith(c),d.use("moodle-core-actionmenu",function(){if(null===M.core.actionmenu.instance)M.core.actionmenu.init();else{var a=d.one(c.get(0));M.core.actionmenu.newDOMNode(a.ancestor())}})};return{menu:function(d,f){a(f).each(function(f,g){var h=[];a(g).find("li").each(function(b,c){h.push(a(c).html().trim())});var i={triggerMessage:d,links:h},j=a.proxy(e,g);b.render("core/menu",i).done(j).fail(c.exception)})}}});
|
Loading…
Add table
Add a link
Reference in a new issue