backbone.js - jQuery plugin raty.js within Backbone view keeps reloading same star images from server -
whenever hover on wbotelhos/raty.js plugin on page repeatedly fetch star-on.png , star-off.png server stars go on , off. there way use local client cache of images? i'm testing in chrome. use following backbone.view render code insert plugin item element.
render: function(manage) { this.collection.each(function(user) { this.insertview("ul", new user.views.item({ model: user })); }, this); return manage(this).render().then(function(el) { // re-focus if invalid this.$("input.invalid").focus(); this.$(".raty-test").raty(); }); }
to solve wrote github: charlesjshort / raty forked wbotelhos/raty replace code setting image source setsource function sets images object in localstorage array. use github: doomhz/jquery-image-cache preload images localstorage array.
Comments
Post a Comment