MDL-43271 JavaScript: Migrate moodle-course-formatchooser to use Shifter
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
YUI.add('moodle-course-formatchooser', function (Y, NAME) {
|
||||
|
||||
var FORMATCHOOSER = function() {
|
||||
FORMATCHOOSER.superclass.constructor.apply(this, arguments);
|
||||
};
|
||||
|
||||
Y.extend(FORMATCHOOSER, Y.Base, {
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
|
||||
var formatselect = Y.one('#'+params.formid+' #id_format');
|
||||
if (updatebut && formatselect) {
|
||||
updatebut.setStyle('display', 'none');
|
||||
formatselect.on('change', function() {
|
||||
updatebut.simulate('click');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.course = M.course || {};
|
||||
M.course.init_formatchooser = function(params) {
|
||||
return new FORMATCHOOSER(params);
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["base", "node", "node-event-simulate"]});
|
||||
+1
@@ -0,0 +1 @@
|
||||
YUI.add("moodle-course-formatchooser",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(t){if(t&&t.formid){var n=e.one("#"+t.formid+" #id_updatecourseformat"),r=e.one("#"+t.formid+" #id_format");n&&r&&(n.setStyle("display","none"),r.on("change",function(){n.simulate("click")}))}}}),M.course=M.course||{},M.course.init_formatchooser=function(e){return new n(e)}},"@VERSION@",{requires:["base","node","node-event-simulate"]});
|
||||
@@ -0,0 +1,28 @@
|
||||
YUI.add('moodle-course-formatchooser', function (Y, NAME) {
|
||||
|
||||
var FORMATCHOOSER = function() {
|
||||
FORMATCHOOSER.superclass.constructor.apply(this, arguments);
|
||||
};
|
||||
|
||||
Y.extend(FORMATCHOOSER, Y.Base, {
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
|
||||
var formatselect = Y.one('#'+params.formid+' #id_format');
|
||||
if (updatebut && formatselect) {
|
||||
updatebut.setStyle('display', 'none');
|
||||
formatselect.on('change', function() {
|
||||
updatebut.simulate('click');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.course = M.course || {};
|
||||
M.course.init_formatchooser = function(params) {
|
||||
return new FORMATCHOOSER(params);
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["base", "node", "node-event-simulate"]});
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
YUI.add('moodle-course-formatchooser', function(Y) {
|
||||
var FORMATCHOOSER = function() {
|
||||
FORMATCHOOSER.superclass.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Y.extend(FORMATCHOOSER, Y.Base, {
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
|
||||
var formatselect = Y.one('#'+params.formid+' #id_format');
|
||||
if (updatebut && formatselect) {
|
||||
updatebut.setStyle('display', 'none');
|
||||
formatselect.on('change', function() {
|
||||
updatebut.simulate('click');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.course = M.course || {};
|
||||
M.course.init_formatchooser = function(params) {
|
||||
return new FORMATCHOOSER(params);
|
||||
}
|
||||
}, '@VERSION@', {requires:['base', 'node', 'node-event-simulate']});
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "moodle-course-formatchooser",
|
||||
"builds": {
|
||||
"moodle-course-formatchooser": {
|
||||
"jsfiles": [
|
||||
"formatchooser.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
var FORMATCHOOSER = function() {
|
||||
FORMATCHOOSER.superclass.constructor.apply(this, arguments);
|
||||
};
|
||||
|
||||
Y.extend(FORMATCHOOSER, Y.Base, {
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
|
||||
var formatselect = Y.one('#'+params.formid+' #id_format');
|
||||
if (updatebut && formatselect) {
|
||||
updatebut.setStyle('display', 'none');
|
||||
formatselect.on('change', function() {
|
||||
updatebut.simulate('click');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.course = M.course || {};
|
||||
M.course.init_formatchooser = function(params) {
|
||||
return new FORMATCHOOSER(params);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"moodle-course-formatchooser": {
|
||||
"requires": [
|
||||
"base",
|
||||
"node",
|
||||
"node-event-simulate"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user