From d283949fbfc17ac17185a7e80940b4a35c12d075 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 1 Mar 2009 18:46:32 +0000 Subject: [PATCH] allow caller to pass in a pre-built edit dialog git-svn-id: svn://svn.open-ils.org/ILS/trunk@12332 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/EditDialog.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/EditDialog.js b/Open-ILS/web/js/dojo/openils/widget/EditDialog.js index 68f84340f5..7033c0bd88 100644 --- a/Open-ILS/web/js/dojo/openils/widget/EditDialog.js +++ b/Open-ILS/web/js/dojo/openils/widget/EditDialog.js @@ -26,19 +26,21 @@ if(!dojo._hasResource['openils.widget.EditDialog']) { editPane : null, // reference to our EditPane object constructor : function(args) { - this.editPane = new openils.widget.EditPane(args); + args = args || {}; + this.editPane = args.editPane || new openils.widget.EditPane(args); var self = this; + var onCancel = args.onCancel || this.editPane.onCancel; + var onSubmit = args.onSubmit || this.editPane.onSubmit; + this.editPane.onCancel = function() { - if(args.onCancel) - args.onCancel(); + if(onCancel) onCancel(); self.hide(); } this.editPane.onPostSubmit = function(r) { self.hide(); - if(args.onPostSubmit) - args.onPostSubmit(r); + if(onSubmit) onSubmit(r); } }, -- 2.43.2