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 18b2824
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 26 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
59 changes: 37 additions & 22 deletions spec/widgets/thumbnailsView.test.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,87 @@
describe('ThumbnailsView', function() {

beforeEach(function() {

describe('ThumbnailsView', function () {

beforeEach(function () {
this.eventEmitter = new Mirador.EventEmitter();
this.viewerDiv = jQuery('<div>');
this.workspace = {
setLayout: jasmine.createSpy()
};
this.view = new Mirador.ThumbnailsView({
appendTo: this.viewerDiv,
workspace: this.workspace,
state: new Mirador.SaveController({eventEmitter: this.eventEmitter}),
eventEmitter: this.eventEmitter
});
});

afterEach(function() {
afterEach(function () {

});

xdescribe('Initialization', function() {
it('should initialize', function() {
xdescribe('Initialization', function () {
it('should initialize', function () {

});
});

xdescribe('loadContent', function() {
xdescribe('loadContent', function () {

});

xdescribe('updateImage', function() {
xdescribe('updateImage', function () {

});

xdescribe('updateFocusImages', function() {
xdescribe('updateFocusImages', function () {

});

xdescribe('currentImageChanged', function() {
xdescribe('currentImageChanged', function () {

});

xdescribe('listenForActions', function() {
xdescribe('listenForActions', function () {

});

xdescribe('bindEvents', function() {
xdescribe('bindEvents', function () {

});

xdescribe('toggle', function() {
xdescribe('toggle', function () {

});

xdescribe('loadImages', function() {
xdescribe('loadImages', function () {

});

xdescribe('loadImage', function() {
xdescribe('loadImage', function () {

});

xdescribe('reloadImages', function() {
xdescribe('reloadImages', function () {

});

xdescribe('hide', function() {
xdescribe('hide', function () {

});

xdescribe('show', function() {

describe('show', function () {
it('should show the thumbnailsView', function () {
spyOn(jQuery.fn, 'show');
this.view.show();
expect(jQuery.fn.show).toHaveBeenCalled();
});
});

xdescribe('adjustWidth', function() {

xdescribe('adjustWidth', function () {

});

xdescribe('adjustHeight', function() {
xdescribe('adjustHeight', function () {

});
});

0 comments on commit 18b2824

Please sign in to comment.