Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dialog-promise

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dialog-promise - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

15

lib/dialog-promise.js

@@ -30,3 +30,3 @@ "use strict";

dialogWindow.style[edge]=Math.floor(Math.max(50-dialogWindow[dialogAttr]/2*100/window[windowAttr]))+'%';
}
};
centerDialogEdge('left','offsetWidth','innerWidth');

@@ -36,6 +36,6 @@ centerDialogEdge('top','offsetHeight','innerHeight');

function receiveOpts(target, source){
function receiveOpts(target, source, force){
for(var p in source){
if(source.hasOwnProperty(p)){
if(!(p in target)){
if(!(p in target) || force){
target[p] = source[p];

@@ -81,3 +81,3 @@ }

}
}
};
var closeWindowWithEmptyAnswer = opts.reject?(

@@ -94,2 +94,3 @@ function(){ closeWindow(new Error(DialogPromise.messages.Escaped)); }

if(opts.underElement){
dialogWindow.setAttribute('docked','under');
dialogWindow.style.position='absolute';

@@ -100,2 +101,7 @@ var rect = opts.underElement.getBoundingClientRect();

dialogWindow.style.visibility='visible';
if(dialogWindow.offsetLeft+dialogWindow.offsetWidth>window.innerWidth){
dialogWindow.style.left=Math.max(rect.right-dialogWindow.offsetWidth,0)+'px';
dialogWindow.style.borderColor='red';
dialogWindow.setAttribute('docked','under-right');
}
}else{

@@ -243,2 +249,3 @@ centerDialog(dialogWindow);

imageElement.src=menuOption.img;
receiveOpts(imageElement.style, menuOption.imgStyle||opts.imgStyle||{}, true);
imageElement.addEventListener('click', function(){

@@ -245,0 +252,0 @@ done(menuOption.value);

{
"name": "dialog-promise",
"description": "Dialog that returns promises",
"version": "0.3.0",
"version": "0.3.1",
"author": "Codenautas <codenautas@googlegroups.com>",

@@ -6,0 +6,0 @@ "repository": "codenautas/dialog-promise",

@@ -78,5 +78,10 @@ # dialog-promise

option |use
---------------|-------------------------------------
`underElement` | the dialog apears below this element. If no element is passed the dialog apears in the center of the window
option |def |use
------------------|--------------|----------------------------------
`underElement` |`null` |the dialog apears below this element. If no element is passed the dialog apears in the center of the window
`withCloseButton` |`true` |display the close button
`mainAttrs` |`{}` |attributes for main dialog window
`reject` |`true` |true if rejects the promise when close by the close button, Esc key or clicking outside of the dialog
`closeValue` |`undefined` |value if rejects the promise when close by the close button, Esc key or clicking outside of the dialog
`buttonDef` |`{label:'Ok', value:true}`|main button of the alertPromise dialog

@@ -83,0 +88,0 @@ ## License

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc