Last active
January 3, 2016 05:39
Revisions
-
rsoares revised this gist
Jan 14, 2014 . 2 changed files with 19 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ var MyView = Backbone.View.extend({ // ... /* Override insert function. */ insert: function(root, child) { var $lastView = root.find( ".foo" ).last(), $lastBar = root.find( ".foo.bar" ).last(); if( $lastView.length ) { child.insertAfter( $lastView ); } else if( $lastBar.length ) { child.insertAfter( $lastBar ); } else { root.append( child ); } } // ... }) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ -
rsoares created this gist
Jan 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ h1 Insert nested views into specific positions