| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- var Component = Model.extend({
- el: null,
- setElement: function(el) {
- this.el = el;
- this.bindGlobalHandlers();
- this.renderSkeleton();
- this.set('isInDom', true);
- },
- removeElement: function() {
- this.unset('isInDom');
- this.unrenderSkeleton();
- this.unbindGlobalHandlers();
- this.el.remove();
- // NOTE: don't null-out this.el in case the View was destroyed within an API callback.
- // We don't null-out the View's other jQuery element references upon destroy,
- // so we shouldn't kill this.el either.
- },
- bindGlobalHandlers: function() {
- },
- unbindGlobalHandlers: function() {
- },
- /*
- NOTE: Can't have a `render` method. Read the deprecation notice in View::executeDateRender
- */
- // Renders the basic structure of the view before any content is rendered
- renderSkeleton: function() {
- // subclasses should implement
- },
- // Unrenders the basic structure of the view
- unrenderSkeleton: function() {
- // subclasses should implement
- }
- });
|