File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
app/assets/javascripts/cms Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ var Sitemap = function() {
3030// @return [Selector] The currently selected section in the sitemap. If a page or other child is selected, this will be
3131// that element's parent.
3232Sitemap . prototype . currentSection = function ( ) {
33- console . log ( this . selectedSection ) ;
3433 return $ ( this . selectedSection ) ;
3534} ;
3635
@@ -42,6 +41,20 @@ Sitemap.prototype.clearSelection = function() {
4241 $ ( '.active' ) . removeClass ( 'active' ) ;
4342} ;
4443
44+ // Different Content types have different behaviors when double clicked.
45+ Sitemap . prototype . _doubleClick = function ( event ) {
46+ var type = $ ( event . target ) . data ( 'type' ) ;
47+ switch ( type )
48+ {
49+ case 'section' :
50+ case 'link' :
51+ $ ( '#properties-button' ) [ 0 ] . click ( ) ;
52+ break ;
53+ default :
54+ $ ( '#edit-button' ) [ 0 ] . click ( ) ;
55+ }
56+ } ;
57+
4558// @return [Selector]
4659Sitemap . prototype . selectedContent = function ( ) {
4760 return $ ( this . selectedRow ) ;
@@ -130,7 +143,7 @@ $(function() {
130143 $ ( '.selectable' ) . click ( function ( ) {
131144 sitemap . selectRow ( $ ( this ) ) ;
132145 } ) ;
133-
146+ $ ( '.selectable' ) . dblclick ( sitemap . _doubleClick ) ;
134147 sitemap . clickWebsite ( ) ;
135148} ) ;
136149
Original file line number Diff line number Diff line change 66* Keep open/closed/last selected state of sitemap
77* Audit/Delete/merge js/cms/sitemap.js.erb
88* No visual indicator of an empty section
9- * Doubleclicking on items
109* page_editor.css/page_content_editing.css shouldn't have been deleted.
1110* Can't edit the root section
1211* Delete old sitemap pages (_ section.old.erb, etc)
You can’t perform that action at this time.
0 commit comments