From 9f6373517c34405641900a43f78f1a0920b9bdac Mon Sep 17 00:00:00 2001 From: vtphan Date: Fri, 24 Jul 2015 14:43:16 +0200 Subject: [PATCH] modal confirm : btn_cancel optionnal and show another modal in callback function --- Source/simple-modal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/simple-modal.js b/Source/simple-modal.js index f6c3abd..23481b1 100755 --- a/Source/simple-modal.js +++ b/Source/simple-modal.js @@ -115,13 +115,14 @@ var SimpleModal = new Class({ case "confirm": // Add button confirm this.addButton(this.options.btn_ok, "btn primary btn-margin", function(){ - try{ options.callback() } catch(err){}; this.hide(); + try{ options.callback() } catch(err){}; }) // Add button cancel - this.addButton(this.options.btn_cancel, "btn secondary"); - + if(this.options.btn_cancel!==false){ + this.addButton(this.options.btn_cancel, "btn secondary"); + } // Rendering var node = this._drawWindow(options);