git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@35 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -26,6 +26,9 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/index/indexViewTemplat
|
||||
}
|
||||
});*/
|
||||
},
|
||||
onShowed: function(){
|
||||
$('body').scrollTop(0);
|
||||
},
|
||||
//render the content into div of view
|
||||
render: function () {
|
||||
if (this.created === true)
|
||||
|
||||
@@ -53,6 +53,9 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
}
|
||||
);
|
||||
},
|
||||
onShowed: function(){
|
||||
$('body').scrollTop(0);
|
||||
},
|
||||
//render the content into div of view
|
||||
render: function () {
|
||||
if (this.fetchedIngredienti && this.fetchedRicetta)
|
||||
@@ -69,9 +72,14 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
ingredienti: self.collIngredienti.toJSON()
|
||||
}));
|
||||
|
||||
self.scrollPositions = [];
|
||||
self.$arrayContent = self.$el.find('div[data-role="content"]');
|
||||
self.$arrayNavBar = self.$el.find('div[data-role="navbar"] a');
|
||||
|
||||
for (var i = self.$arrayContent.length - 1; i >= 0; i--) {
|
||||
self.scrollPositions.push(0);
|
||||
};
|
||||
|
||||
var favBtn = self.$el.find('#favoriteBtn');
|
||||
if (exist > 0)
|
||||
favBtn.addClass('ui-disabled');
|
||||
@@ -108,8 +116,10 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
||||
{
|
||||
if (this.$arrayContent.length > newIndex && newIndex >= 0)
|
||||
{
|
||||
this.scrollPositions[this.indexContent] = $('body').scrollTop();
|
||||
this.indexContent = newIndex;
|
||||
this.switchContent();
|
||||
$('body').scrollTop(this.scrollPositions[this.indexContent]);
|
||||
}
|
||||
},
|
||||
switchContent: function () {
|
||||
|
||||
Reference in New Issue
Block a user