Skip to content

Instantly share code, notes, and snippets.

@jrburke
Created September 5, 2013 23:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrburke/6457819 to your computer and use it in GitHub Desktop.
Save jrburke/6457819 to your computer and use it in GitHub Desktop.
_waitForTransitionEnd: function(cardId) {
var client = this.client;
client.waitFor(function() {
var condition = false;
client.executeScript(
function() {
var Cards = window.wrappedJSObject.require('mail_common').Cards,
card = Cards._cardStack[Cards.activeCardIndex],
cardNode = card && card.domNode;
return cardNode && cardNode.dataset.type === cardId &&
!Cards._eatingEventsUntilNextCard;
},
function(error, result) {
if (result === true) {
condition = true;
}
}
);
return condition;
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment