MDL-49783 forms: Collapsed form section is opened on error
This commit is contained in:
+19
-1
@@ -44,6 +44,17 @@ M.core.event = {
|
||||
FILTER_CONTENT_UPDATED: "filter-content-updated"
|
||||
};
|
||||
|
||||
M.core.globalEvents = {
|
||||
/**
|
||||
* This event is triggered when form has an error
|
||||
*
|
||||
* @event "form_error"
|
||||
* @param formid {string} Id of form with error.
|
||||
* @param elementid {string} Id of element with error.
|
||||
*/
|
||||
FORM_ERROR: "form_error"
|
||||
};
|
||||
|
||||
|
||||
var eventDefaultConfig = {
|
||||
emitFacade: true,
|
||||
@@ -58,6 +69,8 @@ var eventDefaultConfig = {
|
||||
}
|
||||
};
|
||||
|
||||
// Publish events with a custom config here.
|
||||
|
||||
// Publish all the events with a standard config.
|
||||
var key;
|
||||
for (key in M.core.event) {
|
||||
@@ -66,7 +79,12 @@ for (key in M.core.event) {
|
||||
}
|
||||
}
|
||||
|
||||
// Publish events with a custom config here.
|
||||
//Publish all the global events.
|
||||
for (key in M.core.globalEvents) {
|
||||
if (M.core.globalEvents.hasOwnProperty(key)) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: 2}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["event-custom"]});
|
||||
|
||||
@@ -1 +1 @@
|
||||
YUI.add("moodle-core-event",function(e,t){var n="moodle-core-event";M.core=M.core||{},M.core.event={FILTER_CONTENT_UPDATED:"filter-content-updated"};var r={emitFacade:!0,defaultFn:function(e){},preventedFn:function(e){},stoppedFn:function(e){}},i;for(i in M.core.event)M.core.event.hasOwnProperty(i)&&e.publish(M.core.event[i],r)},"@VERSION@",{requires:["event-custom"]});
|
||||
YUI.add("moodle-core-event",function(e,t){var n="moodle-core-event";M.core=M.core||{},M.core.event={FILTER_CONTENT_UPDATED:"filter-content-updated"},M.core.globalEvents={FORM_ERROR:"form_error"};var r={emitFacade:!0,defaultFn:function(e){},preventedFn:function(e){},stoppedFn:function(e){}},i;for(i in M.core.event)M.core.event.hasOwnProperty(i)&&e.publish(M.core.event[i],r);for(i in M.core.globalEvents)M.core.globalEvents.hasOwnProperty(i)&&e.Global.publish(M.core.globalEvents[i],e.merge(r,{broadcast:2}))},"@VERSION@",{requires:["event-custom"]});
|
||||
|
||||
+19
-1
@@ -44,6 +44,17 @@ M.core.event = {
|
||||
FILTER_CONTENT_UPDATED: "filter-content-updated"
|
||||
};
|
||||
|
||||
M.core.globalEvents = {
|
||||
/**
|
||||
* This event is triggered when form has an error
|
||||
*
|
||||
* @event "form_error"
|
||||
* @param formid {string} Id of form with error.
|
||||
* @param elementid {string} Id of element with error.
|
||||
*/
|
||||
FORM_ERROR: "form_error"
|
||||
};
|
||||
|
||||
|
||||
var eventDefaultConfig = {
|
||||
emitFacade: true,
|
||||
@@ -55,6 +66,8 @@ var eventDefaultConfig = {
|
||||
}
|
||||
};
|
||||
|
||||
// Publish events with a custom config here.
|
||||
|
||||
// Publish all the events with a standard config.
|
||||
var key;
|
||||
for (key in M.core.event) {
|
||||
@@ -63,7 +76,12 @@ for (key in M.core.event) {
|
||||
}
|
||||
}
|
||||
|
||||
// Publish events with a custom config here.
|
||||
//Publish all the global events.
|
||||
for (key in M.core.globalEvents) {
|
||||
if (M.core.globalEvents.hasOwnProperty(key)) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: 2}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["event-custom"]});
|
||||
|
||||
Vendored
+19
-1
@@ -42,6 +42,17 @@ M.core.event = {
|
||||
FILTER_CONTENT_UPDATED: "filter-content-updated"
|
||||
};
|
||||
|
||||
M.core.globalEvents = {
|
||||
/**
|
||||
* This event is triggered when form has an error
|
||||
*
|
||||
* @event "form_error"
|
||||
* @param formid {string} Id of form with error.
|
||||
* @param elementid {string} Id of element with error.
|
||||
*/
|
||||
FORM_ERROR: "form_error"
|
||||
};
|
||||
|
||||
|
||||
var eventDefaultConfig = {
|
||||
emitFacade: true,
|
||||
@@ -56,6 +67,8 @@ var eventDefaultConfig = {
|
||||
}
|
||||
};
|
||||
|
||||
// Publish events with a custom config here.
|
||||
|
||||
// Publish all the events with a standard config.
|
||||
var key;
|
||||
for (key in M.core.event) {
|
||||
@@ -64,4 +77,9 @@ for (key in M.core.event) {
|
||||
}
|
||||
}
|
||||
|
||||
// Publish events with a custom config here.
|
||||
//Publish all the global events.
|
||||
for (key in M.core.globalEvents) {
|
||||
if (M.core.globalEvents.hasOwnProperty(key)) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: 2}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user