git-svn-id: https://msi/svn/firstRepo/WebClient/trunk@15 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2014-12-10 15:06:13 +00:00
parent 876ee18579
commit f57f55e2a9
58 changed files with 873 additions and 487 deletions
+21 -3
View File
@@ -1,5 +1,7 @@
define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.html', 'modules/base/baseView', 'classes/profile'],
function($, _, Backbone, homeViewTemplate, BaseView, Profile){
define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.html',
'modules/base/baseView', 'classes/profile', 'classes/utility', 'model/lastRicette/lastRicetteCollection', 'modules/lastricette/lastRicette'],
function($, _, Backbone, homeViewTemplate,
BaseView, Profile, Utility, LastRicetteCollection, LastRicette ){
var HomeView = BaseView.extend({
@@ -12,7 +14,8 @@ define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.h
},
events: {
"click #goFbGroup": "goFbGroup"
"click #goFbGroup": "goFbGroup",
"click #notifyBtn": "onNotifyBtn"
},
goFbGroup: function(){
@@ -20,6 +23,14 @@ define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.h
window.location.href = "https://www.facebook.com/groups/732844273469518/";
},
onNotifyBtn:function(){
var lastricette = new LastRicetteCollection();
// will render home view and navigate to homeView
var lastRicetteView=new LastRicette({ collection: lastricette});
//indexView.render();
lastRicetteView.bind('renderCompleted:Categories',Utility.changePage,this);
},
onShowed: function()
{
if(window.localStorage.getItem("goFbGroup") !== "1")
@@ -38,6 +49,13 @@ define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.h
this.$el.append(this.footer.$el);
this.$el.find("#homeBtn").addClass("ui-btn-active");
var lastNumRicette = Profile.getLastNumRicette();
//if( lastNumRicette > 0)
{
this.$el.find('#notifyBtn').closest('.ui-btn').show();
this.$el.find('#notifyBtn').addClass("notification");
this.$el.find('.circle').text(12);
}
//$("#homeBtn").addClass("ui-btn-active");
//return to enable chained calls
return this;