We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ff6006 commit a237d60Copy full SHA for a237d60
src/client/javascript/api.js
@@ -1127,6 +1127,8 @@
1127
/**
1128
* Create a new dialog
1129
*
1130
+ * You can also pass a function as `className` to return an instance of your own class
1131
+ *
1132
* @param String className Dialog Namespace Class Name
1133
* @param Object args Arguments you want to send to dialog
1134
* @param Function callback Callback on dialog action (close/ok etc) => fn(ev, button, result)
@@ -1154,7 +1156,7 @@
1154
1156
callback.apply(null, arguments);
1155
1157
}
1158
- var win = new OSjs.Dialogs[className](args, cb);
1159
+ var win = typeof className === 'string' ? new OSjs.Dialogs[className](args, cb) : className(args, cb);
1160
1161
if ( !parentObj ) {
1162
var wm = OSjs.Core.getWindowManager();
0 commit comments