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

This commit is contained in:
2016-02-01 17:02:23 +00:00
parent fc7970ec57
commit 7737c750eb
8 changed files with 142 additions and 37 deletions
+8 -5
View File
@@ -1,6 +1,6 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/category/categoryViewTemplate.html',
'text!modules/category/categoryItemTemplate.html', 'modules/base/baseView', 'libs/fastclick', 'classes/debug'],
function ($, _, Backbone, categoryViewTemplate, categoryItemTemplate, BaseView, FastClick, Debug) {
'text!modules/category/categoryItemTemplate.html', 'modules/base/baseView', 'libs/fastclick', 'classes/debug', 'classes/images'],
function ($, _, Backbone, categoryViewTemplate, categoryItemTemplate, BaseView, FastClick, Debug, Images) {
var CategoryView = BaseView.extend({
collection: null,
@@ -20,7 +20,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/category/categoryViewT
this.$el.find('#allRicette').length === 0){
this.collection.fetch({
success: function (data, textStatus, jqXHR) {
self.renderItem();
setTimeout(self.renderItem(), 0);
}
});
}
@@ -37,9 +37,12 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/category/categoryViewT
/*_.each(this.collection.toJSON(), function (d) {
html += self.itemtemplate(d);
});*/
html = this.itemtemplate(this.collection.toJSON());
html = this.itemtemplate({
items: this.collection.toJSON(),
images: Images
});
$ul.html(html);
$(html).appendTo($ul).enhanceWithin();
$ul.listview("refresh");
//$ul.trigger("updatelayout");
}
@@ -1,12 +1,12 @@
<% if(data.length == 0){ %>
<% if(data.items.length == 0){ %>
<h1>Nessuna ricetta trovata</h1>
<%} else { for (var i = 0; i < data.length; i++) { %>
<% var item = data[i]; %>
<li><a href="#ricetta/<%= item.ricetta_id%>" class="ui-btn ui-btn-icon-right ui-icon-carat-r">
<%} else { for (var i = 0; i < data.items.length; i++) { %>
<% var item = data.items[i]; %>
<li><a href="#ricetta/<%= item.ricetta_id%>" class="ui-btn ui-btn-icon-right ui-icon-carat-r ui-li-has-thumb">
<% if(item.firstImage === ""){ %>
<!--<img class="thmbImg emptyItemList">-->
<img class="thmbImg emptyItemList">
<%}else{%>
<!--<img class="thmbImg" src='<%=myManifest.Settings.DefaultURL%>/api/photo/thumbnail/<%=item.firstImage%>'>-->
<img class="thmbImg" src='<%=data.images.getThumb(item.firstImage)%>'>
<%}%>
<div class='ricettaTitolo'><%= unescape(item.titolo) %></div>
<div class='ricettaAutore'><%= unescape(item.autore) %></div>