var Printer = Backbone.Model.extend({
defaults: {
name: 'DuraLabel 9000 (PS)',
features: [{
id: 0,
title: 'Large Labels',
description: 'From 4” – 9” width, print signs and large labels at any length. Bold 300 dpi HD print resolution means you can go ahead and print that billboard. '
}, {
id: 1,
title: 'Harsh Environments',
description: 'Tough tested vinyl supply will withstand the most extreme outdoor environments on the planet. From -300⁰F to 300⁰F degrees, chemical exposures, to wet, dirty or oily surfaces—your signs and labels will hold up. '
}, {
id: 2,
title: 'Go Network Free with the PS',
description: 'Use the 10” touchscreen, seated in an ergonomically adjustable bracket on the PS model for a standalone workstation. Network independence allows you to print on demand from the plant to the warehouse.'
}]
}
});
var PrinterDetailView = Backbone.View.extend({
initialize: function (options) {
this.descriptionView = new DescriptionView({
el: $('#descriptionView'),
model: printer,
featureId: 0
});
this.render()
},
events: {
'click circle': 'animateView'
},
animateView: function (e) {
var target = $(e.currentTarget).data('feature-id');
this.descriptionView.featureId = target;
console.log(this.descriptionView.featureId)
this.descriptionView.render()
},
render: function () {
var template = _.template($("#printerDetailViewTemplate").html(), {
});
this.$el.html(template);
}
});
var DescriptionView = Backbone.View.extend({
//template: _.template($('#descriptionViewTemplate').html()),
initialize: function (options) {
this.model = options.model;
this.featureId = options.featureId
this.render();
},
render: function...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.