@@ -46,9 +46,6 @@ $(document).ready(function () {
4646 Editors . init ( ) ;
4747 IdeSettings . init ( Editors ) ;
4848
49- var $header = $ ( 'header' ) ;
50- var $editorsContentContainer = Editors . getTabsContentContainer ( ) ;
51-
5249 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5350
5451
@@ -76,8 +73,13 @@ $(document).ready(function () {
7673 } ) ;
7774
7875 // Handle resize of window (keep editor under navigation)
76+ var $header = $ ( 'header' ) ;
77+ var $tabsContentContainer = Editors . getTabsContentContainer ( ) ;
78+ var statusBarHeight = $tabsContentContainer . find ( '.ace-status-bar' ) . first ( ) . height ( ) ;
79+
7980 $ ( window ) . on ( 'resize' , function ( ) {
80- $editorsContentContainer . css ( 'top' , Math . ceil ( $header . height ( ) ) + 'px' ) ;
81+ $tabsContentContainer . css ( 'top' , Math . ceil ( $header . height ( ) ) + 'px' ) ;
82+ $tabsContentContainer . find ( '.editor' ) . css ( 'height' , Math . ceil ( $tabsContentContainer . height ( ) - statusBarHeight ) + 'px' ) ;
8183 } ) . resize ( ) ;
8284
8385 // New ace editor
@@ -130,37 +132,24 @@ $(document).ready(function () {
130132
131133
132134 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
133- /// Actions
135+ /// File Actions
134136 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
135137
136138 // Add new tab (editor)
137139 $ ( document ) . on ( 'click' , '.action-add-tab' , function ( ) {
138140 Editors . onAddNewTab ( $ ( this ) . attr ( 'data-type' ) ) ;
139141 } ) ;
140142
141- // Perform copy on current active editor
142- $ ( document ) . on ( 'click' , '.action-copy' , function ( ) {
143- var ace = Editors . getCurrentAceEditor ( ) ;
144- if ( typeof ace !== typeof undefined ) {
145- ace . execCommand ( 'copy' ) ;
146- }
147- } ) ;
148143
149- // Perform paste to current active editor
150- $ ( document ) . on ( 'click' , '.action-paste' , function ( ) {
151- var ace = Editors . getCurrentAceEditor ( ) ;
152- if ( typeof ace !== typeof undefined && Editors . aceClipboard . length > 0 ) {
153- ace . execCommand ( 'paste' , Editors . aceClipboard ) ;
154- }
144+ // Open new file
145+ $ ( document ) . on ( 'click' , '.action-file-open' , function ( ) {
146+ Editors . onOpenFile ( ) ;
155147 } ) ;
156148
157- // Perform cut on current active editor
158- $ ( document ) . on ( 'click' , '.action-cut' , function ( ) {
159- var ace = Editors . getCurrentAceEditor ( ) ;
160- if ( typeof ace !== typeof undefined ) {
161- ace . execCommand ( 'cut' ) ;
162- }
163- } ) ;
149+
150+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
151+ /// Edit Actions
152+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
164153
165154 // Perform search on current active editor
166155 $ ( document ) . on ( 'click' , '.action-search' , function ( ) {
@@ -186,6 +175,30 @@ $(document).ready(function () {
186175 }
187176 } ) ;
188177
178+ // Perform cut on current active editor
179+ $ ( document ) . on ( 'click' , '.action-cut' , function ( ) {
180+ var ace = Editors . getCurrentAceEditor ( ) ;
181+ if ( typeof ace !== typeof undefined ) {
182+ ace . execCommand ( 'cut' ) ;
183+ }
184+ } ) ;
185+
186+ // Perform copy on current active editor
187+ $ ( document ) . on ( 'click' , '.action-copy' , function ( ) {
188+ var ace = Editors . getCurrentAceEditor ( ) ;
189+ if ( typeof ace !== typeof undefined ) {
190+ ace . execCommand ( 'copy' ) ;
191+ }
192+ } ) ;
193+
194+ // Perform paste to current active editor
195+ $ ( document ) . on ( 'click' , '.action-paste' , function ( ) {
196+ var ace = Editors . getCurrentAceEditor ( ) ;
197+ if ( typeof ace !== typeof undefined && Editors . aceClipboard . length > 0 ) {
198+ ace . execCommand ( 'paste' , Editors . aceClipboard ) ;
199+ }
200+ } ) ;
201+
189202 // Perform fold all current active editor
190203 $ ( document ) . on ( 'click' , '.action-fold-all' , function ( ) {
191204 var ace = Editors . getCurrentAceEditor ( ) ;
0 commit comments