dialog-promise
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -96,5 +96,10 @@ "use strict"; | ||
}; | ||
var closeWindowWithEmptyAnswer = opts.reject?( | ||
function(){ closeWindow(new Error(DialogPromise.messages.Escaped)); } | ||
):closeWindow.bind(null,opts.closeValue); | ||
var closeWindowWithEmptyAnswer; | ||
if(opts.reject){ | ||
var error=new Error(DialogPromise.messages.Escaped); | ||
error.DialogPromise='Escaped'; | ||
closeWindowWithEmptyAnswer = function(){ closeWindow(error); } | ||
}else{ | ||
closeWindowWithEmptyAnswer = closeWindow.bind(null,opts.closeValue); | ||
} | ||
dialogPromise.addCloseButton[opts.withCloseButton](dialogWindow, closeWindowWithEmptyAnswer); | ||
@@ -235,3 +240,5 @@ dialogConstructor(dialogWindow, closeWindow); | ||
if(!result && opts.reject){ | ||
throw new Error(DialogPromise.messages.NotConfirmed); | ||
var error=new Error(DialogPromise.messages.NotConfirmed); | ||
error.DialogPromise='NotConfirmed'; | ||
throw error; | ||
} | ||
@@ -289,3 +296,7 @@ if(askForNoRepeat && checkbox.checked){ | ||
if(buttonDef.value===false && (opts.rejectWhenCancelPrompt===true || opts.rejectWhenCancelPrompt===null && opts.reject)){ | ||
Object.defineProperty(buttonDef, 'value', { get: function(){ return new Error(DialogPromise.messages.Escaped); }}); | ||
Object.defineProperty(buttonDef, 'value', { get: function(){ | ||
var error=new Error(DialogPromise.messages.Escaped); | ||
error.DialogPromise='Escaped'; | ||
return error; | ||
}}); | ||
} | ||
@@ -292,0 +303,0 @@ }); |
{ | ||
"name": "dialog-promise", | ||
"description": "Dialog that returns promises", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"author": "Codenautas <codenautas@googlegroups.com>", | ||
@@ -15,3 +15,3 @@ "repository": "codenautas/dialog-promise", | ||
"devDependencies": { | ||
"casperjs": "~1.1.3", | ||
"casperjs": "~1.1.4", | ||
"es6-promise": "~4.1.0", | ||
@@ -36,1 +36,2 @@ "phantomjs-prebuilt": "~2.1.14", | ||
} | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22426
449