summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-10-05 14:28:58 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-10-05 14:28:58 -0400
commitaa399523b29bb1cdbff9ed082dd919409bb0e30f (patch)
tree97132eb433a73c2c18bbda22e323944ef8206f0b /www/js
parent43eaa42c6708c2d1280b94e09f91bcbf819fbbd3 (diff)
tweaks to packery
Former-commit-id: ee6a0147819ee24195b8be8b6d58ac177c617ef1
Diffstat (limited to 'www/js')
-rw-r--r--www/js/MontageCtrl.js40
-rw-r--r--www/js/MontageHistoryCtrl2.js3
2 files changed, 26 insertions, 17 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index db4391d1..38e1d1a0 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -129,6 +129,7 @@ angular.module('zmApp.controllers')
//console.log ("POSITION STR IS " + positionsStr);
positions = JSON.parse(positionsStr);
NVRDataModel.log("found a packery layout");
+
layouttype = false;
}
@@ -167,7 +168,7 @@ angular.module('zmApp.controllers')
imagesLoaded(elem).on('always', function () {
//console.log ("******** ALL IMAGES LOADED");
NVRDataModel.debug("All images loaded");
- $scope.allImagesLoaded = true;
+
$ionicLoading.hide();
@@ -181,12 +182,13 @@ angular.module('zmApp.controllers')
});
if (!progressCalled) {
NVRDataModel.log("*** BUG PROGRESS WAS NOT CALLED");
- pckry.reloadItems();
-
}
-
+ NVRDataModel.debug("All images loaded, doing image layout");
$timeout(function () {
-
+ pckry.initShiftLayout(positions, 'data-item-id');
+ //pckry.reloadItems();
+
+
pckry.getItemElements().forEach(function (itemElem) {
draggie = new Draggabilly(itemElem);
pckry.bindDraggabillyEvents(draggie);
@@ -214,15 +216,12 @@ angular.module('zmApp.controllers')
}
- NVRDataModel.debug("All images loaded, doing image layout");
- $timeout(function () {
- pckry.initShiftLayout(positions, 'data-item-id');
- }, 0);
+
}
- $timeout(function () {
- NVRDataModel.log("Force calling resize");
- pckry.shiftLayout();
- }, zm.packeryTimer); // don't ask
+
+ $scope.allImagesLoaded = true;
+ $timeout (function () {
+ pckry.layout();},300);
@@ -242,6 +241,7 @@ angular.module('zmApp.controllers')
//console.log ("POSITIONS MAP " + JSON.stringify(positions));
var ld = NVRDataModel.getLogin();
ld.packeryPositions = JSON.stringify(positions);
+ //console.log ("Saving " + ld.packeryPositions);
NVRDataModel.setLogin(ld);
}
@@ -407,6 +407,7 @@ angular.module('zmApp.controllers')
NVRDataModel.debug("POSITIONS MAP " + JSON.stringify(positions));
var ld = NVRDataModel.getLogin();
ld.packeryPositions = JSON.stringify(positions);
+ //console.log ("Saving " + ld.packeryPositions);
NVRDataModel.setLogin(ld);
});
});
@@ -637,6 +638,7 @@ angular.module('zmApp.controllers')
//console.log ("POSITIONS MAP " + JSON.stringify(positions));
var ld = NVRDataModel.getLogin();
ld.packeryPositions = JSON.stringify(positions);
+ //console.log ("Saving " + ld.packeryPositions);
NVRDataModel.setLogin(ld);
}, 300);
}, 100);
@@ -823,7 +825,7 @@ angular.module('zmApp.controllers')
function orientationChanged() {
NVRDataModel.debug("Detected orientation change, redoing packery resize");
$timeout(function () {
- pckry.onresize();
+ if (pckry) pckry.onresize();
});
}
@@ -851,7 +853,7 @@ angular.module('zmApp.controllers')
NVRDataModel.debug("Setting image mode to snapshot, will change to image when packery is all done");
$scope.allImagesLoaded = false;
$scope.isDragabillyOn = false;
- $scope.allImagesLoaded = false;
+
$scope.gridScale = "grid-item-50";
$scope.LoginData = NVRDataModel.getLogin();
//FIXME
@@ -1036,7 +1038,9 @@ angular.module('zmApp.controllers')
var positions = pckry.getShiftPositions('data-item-id');
//console.log ("POSITIONS MAP " + JSON.stringify(positions));
var ld = NVRDataModel.getLogin();
+
ld.packeryPositions = JSON.stringify(positions);
+ //console.log ("Saving " + ld.packeryPositions);
NVRDataModel.setLogin(ld);
// $scope.slider.monsize = 2;
});
@@ -1070,6 +1074,8 @@ angular.module('zmApp.controllers')
// return;
}
+
+
$scope.sliderChanging = true;
var somethingReset = false;
@@ -1111,14 +1117,16 @@ angular.module('zmApp.controllers')
}
- //pckry.reloadItems();
+ pckry.shiftLayout();
pckry.once('layoutComplete', function () {
$timeout(function () {
var positions = pckry.getShiftPositions('data-item-id');
//console.log ("POSITIONS MAP " + JSON.stringify(positions));
var ld = NVRDataModel.getLogin();
+
ld.packeryPositions = JSON.stringify(positions);
+ //console.log ("Saving " + ld.packeryPositions);
NVRDataModel.setLogin(ld);
$ionicLoading.hide();
$scope.sliderChanging = false;
diff --git a/www/js/MontageHistoryCtrl2.js b/www/js/MontageHistoryCtrl2.js
index d9107a0f..cf621f9f 100644
--- a/www/js/MontageHistoryCtrl2.js
+++ b/www/js/MontageHistoryCtrl2.js
@@ -1283,7 +1283,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
imagesLoaded(elem).once('always', function () {
console.log("******** ALL IMAGES LOADED");
NVRDataModel.debug("All images loaded");
- $scope.allImagesLoaded = true;
+
$ionicLoading.hide();
@@ -1340,6 +1340,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
$timeout(function () {
NVRDataModel.log("Force calling resize");
pckry.layout();
+ $scope.allImagesLoaded = true;
}, zm.packeryTimer); // don't ask