Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround to fix #929 #945

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 () {

});
});