|
@@ -27,14 +27,6 @@ IPE.app = {
|
|
|
IPE.app.bindEvents();
|
|
|
IPE.app.initData();
|
|
|
|
|
|
- $resSpan.text(config.defaultSize);
|
|
|
- textureSizes = config.textureSizes;
|
|
|
- textureSizes.forEach(function(size) {
|
|
|
- href = size == config.defaultSize ? '' : 'href="#"';
|
|
|
-
|
|
|
- $resLinkHolder.append('<a '+href+' class="res-link" data="'+size+'">'+size+'</a> ');
|
|
|
- });
|
|
|
-
|
|
|
// Getting info file
|
|
|
$.ajax({
|
|
|
url: infoUrl + config.defaultSize,
|
|
@@ -98,7 +90,6 @@ IPE.app = {
|
|
|
volumeId = $('#volumeId').val();
|
|
|
|
|
|
$resSpan = $('span#currentRes');
|
|
|
- $resLinkHolder = $('#resolution-link-holder');
|
|
|
|
|
|
volumeUrl = homeUrl + 'volumes/' + volumeId + '/';
|
|
|
infoUrl = volumeUrl + 'texture-info/';
|
|
@@ -141,6 +132,8 @@ IPE.app = {
|
|
|
$(document).on('firstFrameSpritesCompleted', function() {
|
|
|
init();
|
|
|
|
|
|
+ addResolutionLinks();
|
|
|
+
|
|
|
overviewHelper.initOverview(containerOverview);
|
|
|
|
|
|
animate();
|
|
@@ -173,8 +166,7 @@ IPE.app = {
|
|
|
renderer.domElement.style.height = rendererSizeHolder.height.percent + '%';
|
|
|
});
|
|
|
|
|
|
-
|
|
|
- $('#resolution-link-holder').on('click', 'a', function(e) {
|
|
|
+ $resolutionLinks.on('click', 'a', function(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
|
|
@@ -203,6 +195,10 @@ IPE.app = {
|
|
|
useDownloadedTextureImmediately = true;
|
|
|
helper.downloadImage(spriteUrl + textureInfo.sprites[0][0].$oid, 0, 0, false);
|
|
|
$resSpan.text(requestedSize);
|
|
|
+
|
|
|
+ if($('input#hide-content-small-devices').is(':visible')) {
|
|
|
+ $('input#hide-content-small-devices').trigger('click');
|
|
|
+ }
|
|
|
},
|
|
|
dataType: 'json'
|
|
|
});
|
|
@@ -253,8 +249,7 @@ IPE.app = {
|
|
|
|
|
|
|
|
|
$('input#hide-content-small-devices').on('click', function() {
|
|
|
- var $this = $(this)
|
|
|
- $overlay = $('div#overlay-small-devices'),
|
|
|
+ var $overlay = $('div#overlay-small-devices'),
|
|
|
$content = $('div#content-small-devices'),
|
|
|
source = $overlay.attr('source'),
|
|
|
$source = $('#' + source);
|
|
@@ -551,6 +546,9 @@ function init() {
|
|
|
renderer.setClearColor(0xffffff, 1);
|
|
|
container.appendChild(renderer.domElement);
|
|
|
|
|
|
+ maximumTextureSize = renderer.context.getParameter(renderer.context.MAX_TEXTURE_SIZE);
|
|
|
+ // we have to take an power of 2 less
|
|
|
+ maximumTextureSize /= 2;
|
|
|
|
|
|
$canvas = $('canvas', $container);
|
|
|
|
|
@@ -897,3 +895,17 @@ function hideBottomControlsContainer() {
|
|
|
|
|
|
return filledById;
|
|
|
}
|
|
|
+
|
|
|
+function addResolutionLinks() {
|
|
|
+ $resSpan.text(config.defaultSize);
|
|
|
+ textureSizes = config.textureSizes;
|
|
|
+ textureSizes.forEach(function(size) {
|
|
|
+ if(size > maximumTextureSize) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ href = size == config.defaultSize ? '' : 'href="#"';
|
|
|
+
|
|
|
+ $resolutionLinks.append('<a '+href+' class="res-link" data="'+size+'">'+size+'</a> ');
|
|
|
+ });
|
|
|
+}
|