Skip to content

Commit

Permalink
fix(view-slot): Safari and IE are not spec compliant perhaps
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Mar 24, 2015
1 parent 1bf18ea commit bc1ff2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/view-slot.js
Expand Up @@ -71,10 +71,10 @@ export class ViewSlot {
if(this.isAttached){
view.attached();
// Animate page itself
var element = view.firstChild !== null ? view.firstChild.nextElementSibling : null;
if(view.firstChild !== null &&
var element = view.firstChild ? view.firstChild.nextElementSibling : null;
if(view.firstChild &&
view.firstChild.nodeType === 8 &&
element !== null &&
element &&
element.nodeType === 1 &&
element.classList.contains('au-animate')) {
this.animator.enter(element);
Expand Down Expand Up @@ -119,10 +119,10 @@ export class ViewSlot {
return view;
};

var element = view.firstChild !== null && view.firstChild.nextElementSibling ? view.firstChild.nextElementSibling : null;
if(view.firstChild !== null &&
var element = view.firstChild && view.firstChild.nextElementSibling ? view.firstChild.nextElementSibling : null;
if(view.firstChild &&
view.firstChild.nodeType === 8 &&
element !== null &&
element &&
element.nodeType === 1 &&
element.classList.contains('au-animate')) {
return this.animator.leave(element).then( () => {
Expand All @@ -141,10 +141,10 @@ export class ViewSlot {
var rmPromises = [];

children.forEach(child => {
var element = child.firstChild !== null ? child.firstChild.nextElementSibling : null;
if(child.firstChild !== null &&
var element = child.firstChild ? child.firstChild.nextElementSibling : null;
if(child.firstChild &&
child.firstChild.nodeType === 8 &&
element !== null &&
element &&
element.nodeType === 1 &&
element.classList.contains('au-animate')) {
rmPromises.push(this.animator.leave(element).then(() => {
Expand Down Expand Up @@ -199,10 +199,10 @@ export class ViewSlot {
child = children[i];
child.attached();

var element = child.firstChild !== null ? child.firstChild.nextElementSibling : null;
if(child.firstChild !== null &&
var element = child.firstChild ? child.firstChild.nextElementSibling : null;
if(child.firstChild &&
child.firstChild.nodeType === 8 &&
element !== null &&
element &&
element.nodeType === 1 &&
element.classList.contains('au-animate')) {
this.animator.enter(element);
Expand Down
4 changes: 2 additions & 2 deletions src/view.js
Expand Up @@ -9,8 +9,8 @@ export class View {
this.children = children;
this.systemControlled = systemControlled;
this.contentSelectors = contentSelectors;
this.firstChild = fragment.firstChild || null;
this.lastChild = fragment.lastChild || null;
this.firstChild = fragment.firstChild;
this.lastChild = fragment.lastChild;
this.isBound = false;
this.isAttached = false;
}
Expand Down

0 comments on commit bc1ff2b

Please sign in to comment.