$(this).trigger('fluidbook.hashchange', [args.slice()]);
if (args[1] === 'closeview') {
+ console.log('closeview');
return this.setCurrentPage(this.currentPage);
} else if (args[1] === 'page') {
var anchor = this.normalizeAnchor(args[2]);
c = ' ' + c;
}
return '<a href="#/closeview" role="button" aria-label="' + this.fluidbook.l10n.__('close') + '" aria-keyshortcuts="Escape" class="button back' + c + '">' + getSpriteIcon('interface-close') + '</a>';
- }, openAudio: function (audio, callback) {
+ },
+
+ openAudio: function (audio, callback) {
var hash = '#/audio/' + audio;
var a = $('a[href="' + hash + '"]');
var markup = decodeURIComponent($(a).attr('data-audio'));
callback = function () {
};
}
+
if (all || $("#view .mview").length <= 1) {
var currentHash = window.location.hash;
window.location.hash = '#/page/' + this.fluidbook.currentPage;
this._closeView(callback, all, animate);
}
}, _closeView: function (callback, all, animate) {
+
var $this = this;
if (all == undefined) {
all = false;
}
all = all || ($("#view .mview").length <= 1);
+
if (!this.viewMode()) {
this.hideOverlay();
callback();
$("#main").attr('aria-hidden', 'false').show();
$('body').removeClass('view');
} else {
- window.location.hash = $("#view .mview").eq(-2).data('hash');
+ var formerHash = $("#view .mview").eq(-2).data('hash');
+ if (formerHash !== undefined && formerHash !== null) {
+ console.log('goto former hash', formerHash);
+ window.location.hash = formerHash;
+ }
}
resize();
},