From e885fa3ed2cdb1ce0c7b108df168decedc1525b3 Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Sun, 20 Mar 2016 08:21:49 -0400 Subject: fixed keyboard plugin, tweaking packery - seems calling resize helps Former-commit-id: 711388615e23416b3956058b7f15909355b7a3ff --- package.json | 5 ----- www/js/MonitorCtrl.js | 1 + www/js/MontageCtrl.js | 23 +++++++++++++++++++---- www/js/app.js | 2 +- www/templates/montage.html | 4 ++-- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 79d864b1..6064eb22 100644 --- a/package.json +++ b/package.json @@ -76,11 +76,6 @@ ], "cordovaPlatforms": [ "ios", - { - "platform": "ios", - "version": "", - "locator": "ios" - }, { "platform": "android_temp", "version": "", diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index a217a462..fcd11b32 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -275,6 +275,7 @@ angular.module('zmApp.controllers') // console.log("**VIEW ** Monitor Ctrl Entered"); ZMDataModel.setAwake(false); $ionicSideMenuDelegate.canDragContent(true); + $scope.areImagesLoading = true; }); $scope.$on('$ionicView.leave', function () { diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 920571dc..441bbfe3 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -252,6 +252,7 @@ function initPackery() ZMDataModel.zmDebug ("All images loaded"); $ionicLoading.hide(); + if (!progressCalled) { ZMDataModel.zmLog ("*** BUG PROGRESS WAS NOT CALLED"); @@ -287,9 +288,18 @@ function initPackery() //console.log ("Index:"+positions[j].attr+ " with size: " + positions[j].size); } } + + $timeout(function(){ZMDataModel.zmDebug ("All images loaded, doing image layout");pckry.initShiftLayout(positions, 'data-item-id'); },100); - $timeout(function(){ZMDataModel.zmDebug ("Re-doing layout again - to overcome odd layout...");pckry.initShiftLayout(positions, 'data-item-id'); },200); + + $timeout(function(){ZMDataModel.zmLog ("Force calling resize"); pckry.onresize();},300);// don't ask + + + // $timeout(function(){ZMDataModel.zmDebug ("Re-doing layout again - to overcome odd layout...");pckry.initShiftLayout(positions, 'data-item-id'); },200); //$grid.packery( 'initShiftLayout', initPositions, 'data-item-id' ); + + + } }); @@ -488,6 +498,9 @@ function initPackery() { var i; $scope.isDragabillyOn = !$scope.isDragabillyOn; + + $ionicSideMenuDelegate.canDragContent($scope.isDragabillyOn? false: true); + //$timeout(function(){pckry.reloadItems();},10); ZMDataModel.zmDebug ("setting dragabilly to " + $scope.isDragabillyOn); if ($scope.isDragabillyOn) @@ -715,6 +728,7 @@ function initPackery() $scope.$on('$ionicView.enter', function () { + //$scope.areImagesLoading = true; var ld = ZMDataModel.getLogin(); //console.log("Setting Awake to " + ZMDataModel.getKeepAwake()); ZMDataModel.setAwake(ZMDataModel.getKeepAwake()); @@ -794,6 +808,7 @@ function initPackery() $timeout (function() { + pckry.reloadItems(); pckry.once( 'layoutComplete', function() { console.log ("Layout complete"); @@ -805,9 +820,9 @@ function initPackery() // $scope.slider.monsize = 2; }); //layout(pckry); - pckry.layout(); // force here - no shiftlayout - $timeout(function(){pckry.layout(); },100);// don't ask - + $timeout (function(){pckry.layout();}); // force here - no shiftlayout + + },100); }; diff --git a/www/js/app.js b/www/js/app.js index 5b221c93..a471ffe4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1294,7 +1294,7 @@ angular.module('zmApp', [ //cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); // solves screen bouncing on form input // since I am using JS Scroll - cordova.plugins.Keyboard.disableScroll(true); + //cordova.plugins.Keyboard.disableScroll(true); } if (window.StatusBar) { // org.apache.cordova.statusbar required diff --git a/www/templates/montage.html b/www/templates/montage.html index 9d2837a5..2b3667a1 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -44,7 +44,7 @@
-
+
@@ -60,7 +60,7 @@
-
+
-- cgit v1.2.3