Comparing version 0.0.8 to 0.0.9
@@ -208,16 +208,17 @@ 'use strict'; | ||
} else if (target === 'center') { | ||
var selfWidth = dom.offsetWidth; | ||
var selfHeight = dom.offsetHeight; | ||
var windowWidth = window.innerWidth || document.documentElement.clientWidth; | ||
var windowHeight = window.innerHeight || document.documentElement.clientHeight; | ||
var scrollTop = Math.max(window.pageYOffset || 0, document.documentElement.scrollTop); | ||
if (domUtil.getStyle(dom, 'position') === 'fixed') { | ||
scrollTop = 0; | ||
} | ||
dom.style.left = (windowWidth - selfWidth) / 2 + adjustLeft + 'px'; | ||
dom.style.top = Math.max((windowHeight - selfHeight) / 2 + scrollTop + adjustTop, 0) + 'px'; | ||
domUtil.addClass(dom, 'd-popup-center'); | ||
//var selfWidth = dom.offsetWidth; | ||
//var selfHeight = dom.offsetHeight; | ||
// | ||
//var windowWidth = window.innerWidth || document.documentElement.clientWidth; | ||
//var windowHeight = window.innerHeight || document.documentElement.clientHeight; | ||
// | ||
//var scrollTop = Math.max(window.pageYOffset || 0, document.documentElement.scrollTop); | ||
// | ||
//if (domUtil.getStyle(dom, 'position') === 'fixed') { | ||
// scrollTop = 0; | ||
//} | ||
// | ||
//dom.style.left = (windowWidth - selfWidth) / 2 + adjustLeft + 'px'; | ||
//dom.style.top = Math.max((windowHeight - selfHeight) / 2 + scrollTop + adjustTop, 0) + 'px'; | ||
} | ||
@@ -224,0 +225,0 @@ |
{ | ||
"name": "vue-popup", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "A popup mixin for vue.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
21597
717