Skip to content
Snippets Groups Projects
Select Git revision
  • bcc45e24aa6cac11ca93c1b2ccafa795aa2e3eb2
  • master default protected
  • LUFA-170418
  • LUFA-151115
  • LUFA-140928
  • LUFA-140302
  • LUFA-130901
  • LUFA-130901-BETA
  • LUFA-130303
  • LUFA-120730
  • LUFA-120730-BETA
  • LUFA-120219
  • LUFA-120219-BETA
  • LUFA-111009
  • LUFA-111009-BETA
  • LUFA-110528
  • LUFA-110528-BETA
17 results

BootloaderAPI.h

Blame
  • MenuParentView.js 1.44 KiB
    /**
     * Created by aghassaei on 6/2/15.
     */
    
    
    define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
    
        return Backbone.View.extend({
    
            el: "#menuContent",
    
            initialize: function(options){
    
                _.bindAll(this, "render");
    
                if (this._initialize) this._initialize(options);//call subclass
            },
    
            getPropertyOwner: function($target){
                return null;//override in subclasses
            },
    
            deleteExitMenu: function(e){
                return true;
            },
    
            cancelExitMenu: function(e){
                return true;
            },
    
            saveExitMenu: function(e){
                return true;
            },
    
            shouldRender: function(){
                return true;
            },
    
            render: function(){
                if (!this.shouldRender()) return;
                if (this.model.changedAttributes()["currentNav"]) return;
                if ($("input[type=text]").is(":focus")) return;
                if (this._preRender) this._preRender();
                this.$el.html(this.template(this._makeTemplateJSON()));
                if (this._render) this._render();
            },
    
            destroy: function(){
                if (this._destroy) this._destroy();
                this.stopListening();
                this.undelegateEvents();
                this.$el.removeData().unbind();
    //            this.remove();//todo not convinced I have this right yet
    //            Backbone.View.prototype.remove.call(this);
            }
    
        });
    });