From 2cf160d497e501bf254bd8be054c0f5880ab90ca Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 8 Jun 2013 17:37:43 +0200 Subject: restructured webui to single-page-app, removed jinja --- module/web/app/scripts/utils/dialogs.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 module/web/app/scripts/utils/dialogs.js (limited to 'module/web/app/scripts/utils/dialogs.js') diff --git a/module/web/app/scripts/utils/dialogs.js b/module/web/app/scripts/utils/dialogs.js new file mode 100644 index 000000000..13478ff88 --- /dev/null +++ b/module/web/app/scripts/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 -- cgit v1.2.3