From 1aa0eff2752bdd50703fb4974c7d053cbec5c9e2 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Tue, 19 Jan 2016 11:31:25 -0500 Subject: #144 - new feature to lay out monitors as rows or columns. Also fixes #143 Former-commit-id: a124696e7b538bd7e854f6a3f5d8f8b2e3175511 --- www/js/MontageCtrl.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'www/js/MontageCtrl.js') diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index f05967b2..4b167318 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1,7 +1,7 @@ // Controller for the montage view /* jshint -W041 */ /* jslint browser: true*/ -/* global cordova,StatusBar,angular,console,ionic */ +/* global cordova,StatusBar,angular,console,ionic,Masonry */ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '$rootScope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$ionicPopup', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', 'zm', '$ionicPopover', '$controller', 'imageLoadingDataShare', '$window', function ($scope, $rootScope, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $ionicPopup, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, zm, $ionicPopover, $controller, imageLoadingDataShare, $window) { @@ -18,6 +18,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.isReorder = false; var intervalHandleMontage; // will hold image resize timer on long press var montageIndex = 0; // will hold monitor ID to scale in timer + + var gridcontainer; $scope.monitorSize = []; // array with montage sizes per monitor $scope.scaleDirection = []; // 1 = increase -1 = decrease @@ -68,6 +70,20 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' var loginData = ZMDataModel.getLogin(); + $scope.packMontage = true; + + + + + if (0) + { + var elem = angular.element(document.getElementById('.grid')); + var msnry = new Masonry( elem, { + // options + itemSelector: '.grid-item', + columnWidth: 200 + }); + } // -------------------------------------------------------- // Handling of back button in case modal is open should // close the modal @@ -683,6 +699,12 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' }; + + + $scope.toggleMontageDisplayOrder = function() + { + $scope.packMontage = !$scope.packMontage; + }; //--------------------------------------------------------------------- // allows you to resize individual montage windows -- cgit v1.2.3