MDL-49783 forms: Collapsed form section is opened on error
This commit is contained in:
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