summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/utils/dialogs.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-24 17:47:51 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-24 17:47:51 +0100
commitb4fa3cd44d7b6827ca385f60e72d4f7798a3e02f (patch)
treefbf63ffade6444c19902337320a71f803b1e60ba /module/web/static/js/utils/dialogs.js
parentparse category from addons (diff)
downloadpyload-b4fa3cd44d7b6827ca385f60e72d4f7798a3e02f.tar.xz
added confirm dialogs
Diffstat (limited to 'module/web/static/js/utils/dialogs.js')
-rw-r--r--module/web/static/js/utils/dialogs.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/module/web/static/js/utils/dialogs.js b/module/web/static/js/utils/dialogs.js
new file mode 100644
index 000000000..13478ff88
--- /dev/null
+++ b/module/web/static/js/utils/dialogs.js
@@ -0,0 +1,15 @@
+// Loads all helper and set own handlebars rules
+define(['jquery', 'underscore', 'views/abstract/modalView'], function($, _, modal) {
+
+ // Shows the confirm dialog for given context
+ // on success executes func with context
+ _.confirm = function(template, func, context) {
+ template = "text!tpl/" + template;
+ _.requireOnce([template], function(html) {
+ var template = _.compile(html);
+ var dialog = new modal(template, _.bind(func, context));
+ dialog.show();
+ });
+
+ };
+}); \ No newline at end of file