/**
* Initializes a new dictionary.
*/
- init: function() { },
+ init: function() {
+ this._variables = { };
+ },
/**
* Adds an entry.
*/
addCallback: function(identifier, callback) {
this._bindListener();
-
+
if (this._callbacks.isset(identifier)) {
console.debug("[WCF.CloseOverlayHandler] identifier '" + identifier + "' is already bound to a callback");
return false;
/**
* Executes callbacks on click.
*/
- _executeCallbacks: function() {
+ _executeCallbacks: function(event) {
this._callbacks.each(function(pair) {
// execute callback
pair.value();
});
this._setOptions();
+
+ WCF.CloseOverlayHandler.addCallback('WCF.InlineEditor', $.proxy(this._closeAll, this));
+ },
+
+ /**
+ * Closes all inline editors.
+ */
+ _closeAll: function() {
+ for (var $elementID in this._elements) {
+ this._hide($elementID);
+ }
},
/**
if ($hasOptions) {
this._dropdowns[$elementID].addClass('open');
}
+
+ return false;
},
/**
* @param string elementID
*/
_hide: function(elementID) {
- this._dropdowns[elementID].empty().removeClass('open');
+ if (this._dropdowns[elementID]) {
+ this._dropdowns[elementID].empty().removeClass('open');
+ }
}
});