Skip to content

Commit

Permalink
extend custom event 'iscrollTap'
Browse files Browse the repository at this point in the history
instead of singTap in the iscroll list
  • Loading branch information
imyelo committed Mar 5, 2014
1 parent 8ab7760 commit 61fc04c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/modules/views/forum/Row.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ define(function (require, exports, module) {
var RowForumView = BasicView.extend({
tagName: 'li',
events: {
'singleTap': function (e) {
'iscrollTap': function (e) {
console.log(e);
Backbone.stage.change('#!/topic/' + this.model.get('id'), ['slide-right', 'slide-left']);
appCache.get('topicView').$el.find('header .subject').text(sliceSubject(this.$el.find('h4').text()));
}
Expand Down
2 changes: 1 addition & 1 deletion js/modules/views/forums/Forums.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define(function (require, exports, module) {
},
events: {
// 跳转用singleTap触发 防止手误
'singleTap li.forum': function (e) {
'iscrollTap li.forum': function (e) {
var $li = $(e.currentTarget);
if (!this.flag.chooseFavor) {
this.introForum($li);
Expand Down
4 changes: 4 additions & 0 deletions js/utils/iScrollPull.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ define(function (require, exports, module) {
this.scroll = createPullabledScroll(IScroll, '#' + id, {
scrollbars: true,
fadeScrollbars: true,
tap: 'iscrollSourceTap',
probeType: 2,
pullDownOffset: pullDownOffset,
pullUpOffset: pullUpOffset
Expand All @@ -83,6 +84,9 @@ define(function (require, exports, module) {
$pullUpEl.removeClass('flip').addClass('loading');
pullUpAction(); // Execute custom function (ajax call?)
});
this.$el.on('iscrollSourceTap', function (e) {
self.$el.find(e.target).trigger('iscrollTap');
});
};
return iScrollPull;
});

0 comments on commit 61fc04c

Please sign in to comment.