define('app/views/image_list_item', [
    'text!app/templates/image_list_item.html','ember'],
    /**
     *
     * Image List Item View
     *
     * @returns Class
     */
    function(image_list_item_html) {
        return Ember.View.extend({
                tagName:'li',
                
                starImage: function() {
                    var payload = {
                        'action': 'star'
                    };
                    var backend_id = this.image.backend.id
                    var image_id = this.image.id;
                    $.ajax({
                        url: '/backends/' + backend_id + '/images/' + image_id,
                        type: "POST",
                        data: JSON.stringify(payload),
                        contentType: "application/json",
                        headers: { "cache-control": "no-cache" },
                        dataType: "json"
                    });    
                },
                
                didInsertElement: function(){
                    $('#images-list').listview('refresh');
                    try{
                        $('#images-list .ember-checkbox').checkboxradio();    
                    } catch(e){}
                    
                },

                launchImage: function(){
                    var AddView = Mist.MachineAddView.create();
                    AddView.selectProvider(this.image.backend);
                    AddView.selectImage(this.image);
                    $('#images .dialog-add').panel('open');
                },

                template: Ember.Handlebars.compile(image_list_item_html),
        });

    }
);

@@ -535,16 +535,53 @@
 age.id;%0A
+                    var that = this;%0A
         
@@ -601,16 +601,16 @@
 .ajax(%7B%0A
-
         
@@ -937,16 +937,17 @@
 : %22json%22
+,
 %0A       
@@ -963,15 +963,470 @@
     
-%7D);
     
+success: function ()%7B%0A                            var backend = Mist.backendsController.getBackendById(backend_id);%0A                            if (backend.images.content.indexOf(that.image) == -1) %7B%0A                                if (image.star == false) %7B%0A                                    backend.images.content.unshiftObject(that.image);%0A                                %7D%0A                            %7D%0A                        %7D%0A                    %7D);
 %0A   

Fix star image from advanced search in javascript