Updated inventory to Polymer 1

This commit is contained in:
Stefan Zermatten
2017-01-26 10:23:27 +02:00
parent f7a3929c05
commit d710579025
26 changed files with 480 additions and 412 deletions

View File

@@ -71,6 +71,7 @@ const dialogOpenAnimation = ({element, returnElement, dialog}) => {
const dialogRect = dialog.getBoundingClientRect();
const elementRect = element.getBoundingClientRect();
element.style.visibility = "hidden";
returnElement = _.isFunction(returnElement) ? returnElement() : returnElement;
if (returnElement) returnElement.style.visibility = "hidden";
// Get how must the element change to become the dialog
const deltaLeft = elementRect.left - dialogRect.left;
@@ -98,9 +99,11 @@ const dialogOpenAnimation = ({element, returnElement, dialog}) => {
const dialogCloseAnimation = ({element, returnElement, dialog, callback}) => {
// We are returning to a different element
// pop the original element back in and use the returnElement in its place
if (returnElement){
returnElement = _.isFunction(returnElement) ? returnElement() : returnElement;
if (returnElement && returnElement !== element){
let originalElement = element;
element = returnElement;
originalElement.style.transition = "";
originalElement.style.visibility = "";
originalElement.style.transform = "scale(0)";
_.defer(() => {