var $this = this;
$(document).on('click', ".mview .back", function () {
+ var currentHash = window.location.hash;
window.location.hash = '/page/' + $this.fluidbook.currentPage;
+ if (window.location.hash == currentHash) {
+ $this.closeView(function () {
+ }, true);
+ }
+
return false;
});
+
},
viewMode: function () {
this.openChapters(cb);
} else if (view == 'archives') {
this.openArchives($("#nav #archives").data('tooltip'), cb);
+ } else if (view == 'text') {
+ this.openText(param1, cb);
} else {
this['open' + camelView](param1, param2, cb);
}
var from = {y: -200, opacity: 0};
var to = {
y: 0, opacity: 1, onComplete: function () {
- //console.log('end opening view');
- callback();
+ if (callback != undefined) {
+ callback();
+ }
$this.fluidbook.hideLoader();
resize();
}
from.y = 0;
}
TweenMax.fromTo($(mview), 0.5, from, to);
-
},
displayResults: function (data, group, callback) {
if (callback != undefined) {
callback();
}
- }
- ,
+ },
openVideo: function (video, callback) {
var a = $('a[href="#/video/' + video + '"]');
var markup = decodeURIComponent($(a).attr('data-video'));
if (callback != undefined) {
callback();
}
- }
- ,
+ },
+ openText: function (text, callback) {
+ var t = '<div class="caption">' + this.closeButton() + '<h2></h2></div>';
+ t += '<div class="content"><div class="text">' + text + '</div></div>';
+ $("#view").append('<div class="mview" data-menu="text">' + t + '</div>');
+ if (callback != undefined) {
+ callback();
+ }
+ },
closeView: function (callback, all, animate) {
this.hideOverlay();
var $this = this;
forceHeight = true;
}
break;
+ case 'text':
+ w = 600;
+ fullscreen = (w >= ww * 0.9);
+ break;
case 'index':
fullscreen = true;
break;
$("#tooltip").transform({scale: 1 / zoom}).css({'marginTop': 20 / zoom, 'marginLeft': -10 / zoom});
});
-
if (Modernizr.ftouch) {
$(document).on('touchstart', 'a[data-tooltip-touch][data-tooltip]', function (e) {
$this.updateMousePosition(e);
- return $this.eventTriggered(this);
+ $this.eventTriggered(this);
});
} else {
$(document).on('mouseover', 'a[data-tooltip]', function (e) {
$this.updateMousePosition(e);
- return $this.eventTriggered(this);
+ $this.eventTriggered(this);
});
}
$("body").append('<div id="tooltip"></div>');
offsetX = 26 - w;
}
+
var top = this.mouseY + offsetY;
var left = this.mouseX + offsetX;
+ var maxx = this.fluidbook.resize.ww - w;
+ var maxy = this.fluidbook.resize.hh - h;
- $("#tooltip").attr('data-pos-x', x).attr('data-pos-y', y).css({top: Math.max(1, top), left: Math.max(1, left)});
+ $("#tooltip").attr('data-pos-x', x).attr('data-pos-y', y).css({top: Math.max(1, Math.min(top, maxy)), left: Math.max(1, Math.min(left, maxx))});
},
eventTriggered: function (target) {
t.css('maxWidth', 250).html(text).show()
var nbchars = t.text().length;
- var maxWidth = Math.max(250, Math.min(750, nbchars*1.2));
+ var maxWidth = Math.min(this.fluidbook.resize.ww, Math.max(250, Math.min(750, nbchars * 1.2)));
for (var w = 250; w <= maxWidth; w += 25) {
if ((t.height() * 1.5) > t.width()) {
}
}
+ if (t.outerHeight() > this.fluidbook.resize.hh / 2) {
+ t.hide();
+ this.fluidbook.menu.__openView('text', text, function () {
+ });
+ return false;
+ }
+
return true;
},
hideTooltip: function () {
-o-box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -ms-touch-action: double-tap-zoom pinch-zoom;
-ms-scroll-chaining: chained;
-webkit-font-smoothing: antialiased;
font-weight: 600;
}
-.pan, .pan * {
- -ms-touch-action: auto;
- touch-action: auto;
-}
-
html {
user-select: text;
-moz-user-select: text;
-webkit-user-select: text;
-o-user-select: text;
-ms-user-select: text;
+ &.ios {
+ position: fixed;
+ }
}
body {
/* Pages */
.background, .texts {
+ pointer-events: none;
position: absolute;
top: 0px;
left: 0px;
/* Espaces forcés */
+#currentDoublePage{
+ pointer-events: none;
+}
+
.page {
overflow: hidden;
position: absolute;
.link.multimedia {
position: absolute;
z-index: 1 !important;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
&.notinteractive {
pointer-events: none;
display: block;
}
+/* texts */
+.mview .text {
+ padding: 20px;
+ white-space: pre-line;
+ text-align: left;
+}
+
/* Chapters */
ul.chapters {