From 0046ea2b7812f6ab7aa9f4960c756ceafdd09085 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 9 Dec 2013 17:17:16 -0600 Subject: [PATCH] Fixed on-select for list items --- dist/js/ionic-angular.js | 6 +++--- examples/starters/flickr/index.html | 2 +- examples/starters/flickr/script.js | 2 +- examples/starters/flickr/style.css | 6 ++++-- js/ext/angular/src/directive/ionicContent.js | 2 +- js/ext/angular/src/directive/ionicList.js | 4 ++-- js/ext/angular/test/list.html | 8 ++++++-- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index 7c9e481379..e963099a5f 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -719,7 +719,7 @@ angular.module('ionic.ui.content', []) $timeout(function() { sv = new ionic.views.Scroll({ el: $element[0], - scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 40, + scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 20, scrollingComplete: function() { $scope.onScrollComplete({ scrollTop: this.__scrollTop, @@ -816,7 +816,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) type: '@', href: '@' }, - template: '\ + template: '\
\ \
\ @@ -895,7 +895,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) buttons: '=', type: '@', }, - template: '
  • \ + template: '
  • \
    \ \
    \ diff --git a/examples/starters/flickr/index.html b/examples/starters/flickr/index.html index e2f084d539..5831901e85 100644 --- a/examples/starters/flickr/index.html +++ b/examples/starters/flickr/index.html @@ -39,7 +39,7 @@
    -
    +
    diff --git a/examples/starters/flickr/script.js b/examples/starters/flickr/script.js index d109800a93..24a2009b3d 100644 --- a/examples/starters/flickr/script.js +++ b/examples/starters/flickr/script.js @@ -25,7 +25,7 @@ angular.module('myApp', ['ionic', 'ngResource']) Flickr.search(query).then(function(resp) { $scope.photos = resp; }); - }, 300); + }, 500); $scope.search = function() { doSearch($scope.query); diff --git a/examples/starters/flickr/style.css b/examples/starters/flickr/style.css index a54d0fcf7a..9436033fc8 100644 --- a/examples/starters/flickr/style.css +++ b/examples/starters/flickr/style.css @@ -3,8 +3,7 @@ } #photos { --webkit-flex-wrap: wrap; --webkit-flex-direction: row; + margin: auto; } .photo { @@ -17,6 +16,8 @@ .photo img { min-width: 100%; min-height: 100%; + max-width: 150%; + max-height: 150%; } #search-bar { @@ -34,4 +35,5 @@ #content { top: 44px; padding-top: 45px; + padding-bottom: 20px; } diff --git a/js/ext/angular/src/directive/ionicContent.js b/js/ext/angular/src/directive/ionicContent.js index 17fb7e2371..6ad8fd6564 100644 --- a/js/ext/angular/src/directive/ionicContent.js +++ b/js/ext/angular/src/directive/ionicContent.js @@ -95,7 +95,7 @@ angular.module('ionic.ui.content', []) $timeout(function() { sv = new ionic.views.Scroll({ el: $element[0], - scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 40, + scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 20, scrollingComplete: function() { $scope.onScrollComplete({ scrollTop: this.__scrollTop, diff --git a/js/ext/angular/src/directive/ionicList.js b/js/ext/angular/src/directive/ionicList.js index f7f56eca41..ae55443690 100644 --- a/js/ext/angular/src/directive/ionicList.js +++ b/js/ext/angular/src/directive/ionicList.js @@ -20,7 +20,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) type: '@', href: '@' }, - template: '
    \ + template: '\
    \ \
    \ @@ -99,7 +99,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) buttons: '=', type: '@', }, - template: '
  • \ + template: '
  • \
    \ \
    \ diff --git a/js/ext/angular/test/list.html b/js/ext/angular/test/list.html index 864c7bf716..688b255332 100644 --- a/js/ext/angular/test/list.html +++ b/js/ext/angular/test/list.html @@ -77,8 +77,8 @@ can-delete="true" can-reorder="true" can-swipe="true" - on-delete="deleteProject(project)" - on-select="selectProject(project)"> + on-delete="deleteProject(item)" + on-select="selectProject(item)"> {{item.text}} @@ -106,6 +106,10 @@ $scope.items.splice($scope.items.indexOf(item), 1); }; + $scope.selectProject = function(project) { + console.log('Selected project', project); + }; + $scope.almostRefreshing = function() { console.log('HOLDING FOR REFRESH'); };