git-svn-id: https://msi/svn/firstRepo/Management/trunk@49 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
+27
-5
@@ -1,9 +1,11 @@
|
||||
define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.html',
|
||||
'modules/base/baseView', 'modules/ricette/ricette', 'modules/editricetta/editricetta', 'modules/photos/photos',
|
||||
'modules/base/baseView', 'modules/ricette/ricette', 'modules/editricetta/editricetta', 'modules/photos/photos', 'modules/statistics/statistics',
|
||||
'jqx'],
|
||||
function($, _, Backbone, homeViewTemplate, BaseView, RicetteView, EditRicettaView, PhotosView) {
|
||||
function($, _, Backbone, homeViewTemplate, BaseView, RicetteView, EditRicettaView, PhotosView, StatisticsView) {
|
||||
|
||||
var HomeView = BaseView.extend({
|
||||
ricetteView: null,
|
||||
statiView: null,
|
||||
//initialize template
|
||||
template: _.template(homeViewTemplate),
|
||||
initialize: function() {
|
||||
@@ -19,15 +21,30 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
||||
},
|
||||
modifyRicetta: function() {
|
||||
//e.preventDefault();
|
||||
var ricetteView = new RicetteView();
|
||||
ricetteView.render();
|
||||
$('body').append(ricetteView.$el);
|
||||
if(this.ricetteView == null)
|
||||
{
|
||||
this.ricetteView = new RicetteView();
|
||||
this.ricetteView.render();
|
||||
$('body').append(this.ricetteView.$el);
|
||||
}
|
||||
else
|
||||
this.ricetteView.render();
|
||||
},
|
||||
photosView: function(){
|
||||
var photosView = new PhotosView();
|
||||
photosView.render();
|
||||
$('body').append(photosView.$el);
|
||||
},
|
||||
statisticsView: function(){
|
||||
if(this.statiView == null)
|
||||
{
|
||||
this.statiView = new StatisticsView();
|
||||
this.statiView.render();
|
||||
$('body').append(this.statiView.$el);
|
||||
}
|
||||
else
|
||||
this.statiView.render();
|
||||
},
|
||||
clickMenu: function(event) {
|
||||
var item = $(event.target);
|
||||
//var clickedItem = event.args;
|
||||
@@ -46,6 +63,11 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
||||
{
|
||||
event.data.scope.photosView();
|
||||
}
|
||||
else if(item[0].id === "viewStatistics" ||
|
||||
item[0].lastChild.id === "viewStatistics")
|
||||
{
|
||||
event.data.scope.statisticsView();
|
||||
}
|
||||
},
|
||||
//render the content into div of view
|
||||
render: function() {
|
||||
|
||||
@@ -13,19 +13,19 @@
|
||||
<li><a id="addIngredienti" href="#">Aggiungi</a></li>
|
||||
<li><a id="modifyIngredienti" href="#">Modifica</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</li>-->
|
||||
<li>Gestione Foto
|
||||
<ul style='width: 250px;'>
|
||||
<li><a id="viewPhotos" href="#">Visualizza</a></li>
|
||||
<!--<li><a id="publishPhoto" href="#">Approva</a></li>
|
||||
<li><a id="publishPhoto" href="#">Approva</a></li>
|
||||
<li><a id="deletePhoto" href="#">Cancella</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Gestione Profili
|
||||
<ul style='width: 250px;'>
|
||||
<li><a id="viewProfiles" href="#">Visualizza</a></li>
|
||||
<li><a id="viewStatistics" href="#">Statistiche</a></li>
|
||||
</ul>
|
||||
</li>-->
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user