angular-stackables
Advanced tools
Comparing version 0.0.17 to 0.0.18
{ | ||
"name": "angular-stackables", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "AngularJS stackable widgets built on HTML5 dialog.", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "angular-stackables", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"dependencies": {} | ||
} |
@@ -20,2 +20,6 @@ /*! | ||
var usePolyfill = angular.element('<dialog></dialog>'); | ||
usePolyfill = (!usePolyfill[0].showModal && | ||
typeof dialogPolyfill !== 'undefined'); | ||
function stackableDirective() { | ||
@@ -39,7 +43,24 @@ return { | ||
// move dialog to body to simpify z-indexing | ||
body.append(dialog); | ||
// get z-index of parent dialog, if any | ||
var parentDialog = element.parent().closest('dialog'); | ||
if(parentDialog.length > 0) { | ||
var zIndex = parentDialog.css('z-index'); | ||
var zIndexInt = parseInt(zIndex, 10); | ||
if(zIndexInt.toString() !== zIndex) { | ||
zIndex = 0; | ||
} | ||
element.css({'z-index': ++zIndexInt}); | ||
// ensure child dialog is a direct descendant of parent (should work | ||
// for both native modal <dialog> which will only show the child on top | ||
// if it is not moved to the body and for polyfill which relies on | ||
// z-index contexts) | ||
parentDialog.append(dialog); | ||
} else { | ||
// no dialog parent; move dialog to body to simplify z-indexing | ||
body.append(dialog); | ||
} | ||
// use polyfill if necessary | ||
if(!dialog.showModal && typeof dialogPolyfill !== 'undefined') { | ||
if(usePolyfill) { | ||
dialogPolyfill.registerDialog(dialog); | ||
@@ -168,4 +189,4 @@ } | ||
// link stackable dialog | ||
scope.modal = true; | ||
ctrl.link(scope, element); | ||
scope.modal = true; | ||
} | ||
@@ -180,2 +201,4 @@ }; | ||
alignment: '@?stackableAlignment', | ||
closed: '&?stackableClosed', | ||
closing: '&?stackableClosing', | ||
disableBlurClose: '=?stackableDisableBlurClose', | ||
@@ -182,0 +205,0 @@ disableEscape: '=?stackableDisableEscape', |
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
26356
746