File tree 3 files changed +20
-4
lines changed
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,14 @@ angular.module('ionic.ui.list', ['ngAnimate'])
24
24
25
25
template : '<div class="item item-complex">\
26
26
<div class="item-edit" ng-if="deleteClick !== undefined">\
27
- <button class="button button-icon icon" ng-class="deleteIconClass" ng-click="deleteClick()"></button>\
27
+ <button class="button button-icon icon" ng-class="deleteIconClass" ng-click="deleteClick()" stop-event="click" ></button>\
28
28
</div>\
29
29
<a class="item-content" ng-href="{{ href }}" ng-transclude></a>\
30
30
<div class="item-drag" ng-if="reorderIconClass !== undefined">\
31
31
<button data-ionic-action="reorder" class="button button-icon icon" ng-class="reorderIconClass"></button>\
32
32
</div>\
33
33
<div class="item-options" ng-if="itemOptionButtons">\
34
- <button ng-click="b.onTap(item, b)" class="button" ng-class="b.type" ng-repeat="b in itemOptionButtons" ng-bind="b.text"></button>\
34
+ <button ng-click="b.onTap(item, b)" stop-event="click" class="button" ng-class="b.type" ng-repeat="b in itemOptionButtons" ng-bind="b.text"></button>\
35
35
</div>\
36
36
</div>' ,
37
37
Original file line number Diff line number Diff line change @@ -45,7 +45,19 @@ angular.module('ionic.ui.touch', [])
45
45
46
46
} ;
47
47
48
- } ] ) ;
48
+ } ] )
49
+
50
+ . directive ( 'stopEvent' , function ( ) {
51
+ function stopEvent ( e ) {
52
+ e . stopPropagation ( ) ;
53
+ }
54
+ return {
55
+ restrict : 'A' ,
56
+ link : function ( scope , element , attr ) {
57
+ element . bind ( attr . stopEvent , stopEvent ) ;
58
+ }
59
+ } ;
60
+ } ) ;
49
61
50
62
51
63
} ) ( window . angular , window . ionic ) ;
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ <h1 class="title">List Tests</h1>
109
109
option-buttons ="optionButtons1 ">
110
110
111
111
<!-- shows that the item directive does not need attributes and can get values from the list attributes -->
112
- < item item ="item " class ="item-message " ng-repeat ="item in items " ng-class ="{ active: item.isActive} ">
112
+ < item item ="item " ng-click =" itemClick() " class ="item-message " ng-repeat ="item in items " ng-class ="{ active: item.isActive} ">
113
113
< img ng-src ="{{item.face}} ">
114
114
< h2 > {{item.from}}</ h2 >
115
115
< p > {{item.text}}</ p >
@@ -210,6 +210,10 @@ <h1>YELLOW {{slideBox.slideIndex}}</h1>
210
210
} ;
211
211
212
212
213
+ $scope . itemClick = function ( ) {
214
+ console . debug ( 'itemClick' ) ;
215
+ } ;
216
+
213
217
// Item Methods/Properties
214
218
$scope . deleteItem = function ( item ) {
215
219
alert ( 'onDelete from the "item" directive on-delete attribute. Lets not delete this item today ok!' ) ;
You can’t perform that action at this time.
0 commit comments