Skip to content

Commit

Permalink
Add workaround to fix #929 by manually setting the display to block i…
Browse files Browse the repository at this point in the history
…nside the complete animation callback
  • Loading branch information
radpet committed Jun 6, 2016
1 parent 76a35e7 commit 5d4c8cb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
10 changes: 9 additions & 1 deletion js/src/viewer/workspacePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@
},

show: function() {
jQuery(this.element).show({effect: "fade", duration: 160, easing: "easeInCubic"});
var onComplete = function () {
// Under firefox $.show() used under display:none iframe does not change the display.
// This is workaround for https://github.com/IIIF/mirador/issues/929
jQuery(this).css('display', 'block');
};

jQuery(this.element).show({
effect: "fade", duration: 160, easing: "easeInCubic", complete: onComplete
});
},

onPanelVisible: function(_, stateValue) {
Expand Down
8 changes: 7 additions & 1 deletion js/src/widgets/bookView.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ bindEvents: function() {
},

show: function() {
jQuery(this.element).show({effect: "fade", duration: 300, easing: "easeInCubic"});
jQuery(this.element).show({
effect: "fade", duration: 300, easing: "easeInCubic", complete: function () {
// Under firefox $.show() used under display:none iframe does not change the display.
// This is workaround for https://github.com/IIIF/mirador/issues/929
jQuery(this).css('display', 'block');
}
});
},

adjustWidth: function(className, hasClass) {
Expand Down
8 changes: 7 additions & 1 deletion js/src/widgets/imageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,13 @@
},

show: function() {
jQuery(this.element).show({effect: "fade", duration: 300, easing: "easeInCubic"});
jQuery(this.element).show({
effect: "fade", duration: 300, easing: "easeInCubic", complete: function () {
// Under firefox $.show() used under display:none iframe does not change the display.
// This is workaround for https://github.com/IIIF/mirador/issues/929
jQuery(this).css('display', 'block');
}
});
},

adjustWidth: function(className, hasClass) {
Expand Down
9 changes: 8 additions & 1 deletion js/src/widgets/thumbnailsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@
bindEvents: function() {
var _this = this;
_this.element.find('img').on('load', function() {
jQuery(this).hide().fadeIn(750);
jQuery(this).hide().fadeIn(750,function(){
// Under firefox $.show() used under display:none iframe does not change the display.
// This is workaround for https://github.com/IIIF/mirador/issues/929
jQuery(this).css('display', 'block');
});
});

jQuery(_this.element).scroll(function() {
Expand Down Expand Up @@ -199,6 +203,9 @@
duration: 300,
easing: "easeInCubic",
complete: function() {
// Under firefox $.show() used under display:none iframe does not change the display.
// This is workaround for https://github.com/IIIF/mirador/issues/929
jQuery(this).css('display', 'block');
_this.loadImages();
}
});
Expand Down

0 comments on commit 5d4c8cb

Please sign in to comment.