summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2017-12-23 17:40:14 -0500
committerPliable Pixels <pliablepixels@gmail.com>2017-12-23 17:40:14 -0500
commitdc43da401f3a142561b294f3d28e1a6fb3fbafec (patch)
tree57e75aca0dc22d6994e079cc71f006075e6857e2 /www/js
parent8f140f1da396d2590f8987ee46ca28e2dde0538d (diff)
#570 reflow rework of masonry
Diffstat (limited to 'www/js')
-rw-r--r--www/js/MomentCtrl.js39
1 files changed, 27 insertions, 12 deletions
diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js
index dde163f7..fc598456 100644
--- a/www/js/MomentCtrl.js
+++ b/www/js/MomentCtrl.js
@@ -43,22 +43,22 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
function jiggleAway() {
- $timeout(function () {
- masonry.reloadItems();
- }, 100);
+
+ // STEP 3: Called when step 2 completes for the finale
masonry.once('layoutComplete', function (laidOutItems) {
$timeout(function () {
masonry.layout();
- }, 300);
+ }, 10);
});
+ // STEP2: Trigger a layout to re-pack
$timeout(function () {
masonry.layout();
// $ionicScrollDelegate.$getByHandle("moment-delegate").scrollTop();
- }, 600);
+ }, 300);
}
//----------------------------------------------------------------
@@ -286,7 +286,14 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
$scope.moments[i].Event.icon = 'ion-code-working';
$scope.moments[i].Event.collapseCount = '';
}
- jiggleAway();
+
+
+ $timeout(function () {
+ masonry.reloadItems();
+ jiggleAway();
+
+ }, 100);
+
}
function collapseAll() {
@@ -323,7 +330,12 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
} // firstIndex
} // monitor for i
- jiggleAway();
+
+ $timeout(function () {
+ masonry.reloadItems();
+ jiggleAway();
+
+ }, 100);
}
//----------------------------------------------------------------
@@ -378,7 +390,12 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
} else {
$scope.moments[ndx].Event.collapseCount = "";
}
- jiggleAway();
+
+ $timeout(function () {
+ masonry.reloadItems();
+ jiggleAway();
+
+ }, 100);
};
@@ -497,14 +514,12 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
NVRDataModel.debug("All images loaded");
$ionicLoading.hide();
-
- $timeout(function () {
- masonry.layout();
- }, 300);
+ jiggleAway();
if (!progressCalled) {
NVRDataModel.log("*** PROGRESS WAS NOT CALLED");
masonry.reloadItems();
+ jiggleAway();
}
});