diff options
author | Garren Smith <garren.smith@gmail.com> | 2013-12-02 17:30:42 +0200 |
---|---|---|
committer | Garren Smith <garren.smith@gmail.com> | 2013-12-02 17:30:42 +0200 |
commit | 2824db1371d8349e2488fff41a580cf17e7a87a5 (patch) | |
tree | d5e94c0abecc7ad7f19f62ea177ef2704aec23e4 /src | |
parent | 6350e528c72d6b032247d65fee0057f4df4af24a (diff) | |
download | couchdb-2824db1371d8349e2488fff41a580cf17e7a87a5.tar.gz |
Fauxton fixes
Remove white space in editor
Interior tabs on views now collapse
Reworded preview button
Change Advanced Options -> Query Options
Diffstat (limited to 'src')
-rw-r--r-- | src/fauxton/app/modules/documents/views.js | 13 | ||||
-rw-r--r-- | src/fauxton/app/modules/fauxton/components.js | 16 | ||||
-rw-r--r-- | src/fauxton/app/templates/documents/advanced_options.html | 2 | ||||
-rw-r--r-- | src/fauxton/app/templates/documents/view_editor.html | 5 | ||||
-rw-r--r-- | src/fauxton/assets/less/fauxton.less | 1 |
5 files changed, 28 insertions, 9 deletions
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index 39e210dd9..af08974b3 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -1408,17 +1408,22 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) { }, toggleIndexNav: function (event) { - var $index = this.$('#index'), - $targetId = this.$(event.target).attr('id'); + var $targetId = this.$(event.target).attr('id'), + $previousTab = this.$(this.$('li.active a').attr('href')), + $targetTab = this.$(this.$(event.target).attr('href')); + + if ($targetTab.attr('id') !== $previousTab.attr('id')) { + $previousTab.removeAttr('style'); + } if ($targetId === 'index-nav') { if (this.newView) { return; } var that = this; - $index.toggle('slow', function(){ + $targetTab.toggle('slow', function(){ that.showEditors(); }); } else { - $index.removeAttr('style'); + $targetTab.toggle('slow'); } }, diff --git a/src/fauxton/app/modules/fauxton/components.js b/src/fauxton/app/modules/fauxton/components.js index 1263bd488..0443573dd 100644 --- a/src/fauxton/app/modules/fauxton/components.js +++ b/src/fauxton/app/modules/fauxton/components.js @@ -201,6 +201,7 @@ function(app, FauxtonAPI, ace) { afterRender: function () { this.editor = ace.edit(this.editorId); + this.setHeightToLineCount(); this.editor.setTheme("ace/theme/" + this.theme); this.editor.getSession().setMode("ace/mode/" + this.mode); this.editor.getSession().setUseWrapMode(true); @@ -211,6 +212,21 @@ function(app, FauxtonAPI, ace) { if (this.couchJSHINT) { this.removeIncorrectAnnotations(); } + + var that = this; + + this.editor.getSession().on('change', function () { + that.setHeightToLineCount(); + }); + }, + + setHeightToLineCount: function () { + var lines = this.editor.getSession().getDocument().getLength(); + this.editor.setOptions({ + maxLines: lines + }); + + this.editor.resize(); }, addCommands: function () { diff --git a/src/fauxton/app/templates/documents/advanced_options.html b/src/fauxton/app/templates/documents/advanced_options.html index df28203f0..3562f7b25 100644 --- a/src/fauxton/app/templates/documents/advanced_options.html +++ b/src/fauxton/app/templates/documents/advanced_options.html @@ -87,7 +87,7 @@ the License. <div id="button-options" class="controls controls-row"> <button type="submit" class="button btn-primary btn-large">Query</button> <% if (showPreview) { %> - <button class="button btn-info btn-large preview">Preview</button> + <button class="button btn-info btn-large preview">Browser Preview</button> <% } %> </div> </div> diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html index 8fcd07a77..f35b8abfe 100644 --- a/src/fauxton/app/templates/documents/view_editor.html +++ b/src/fauxton/app/templates/documents/view_editor.html @@ -14,8 +14,8 @@ the License. <div class="row"> <ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav"> <li class="active"> <a id="index-nav" class="fonticon-wrench fonticon" data-toggle="tab" href="#index"><% if (newView) { %>Create Index <% } else { %>Edit Index <% } %></a></li> - <li><a class="fonticon-plus fonticon" href="#query" data-toggle="tab">Advanced Options</a></li> - <li><a href="#metadata" data-toggle="tab">Design Doc Metadata</a></li> + <li><a id="query-nav" class="fonticon-plus fonticon" href="#query" data-toggle="tab">Query Options</a></li> + <li><a id="meta-nav" href="#metadata" data-toggle="tab">Design Doc Metadata</a></li> </ul> <div class="all-docs-list errors-container"></div> <div class="tab-content"> @@ -56,7 +56,6 @@ the License. <span class="help-block">Reduce functions are optional.</span> </div> - <div class="control-group reduce-function"> <label for="reduce-function">Custom Reduce</label> <% if (newView) { %> diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less index 252391e1d..3d8d97a0a 100644 --- a/src/fauxton/assets/less/fauxton.less +++ b/src/fauxton/assets/less/fauxton.less @@ -991,7 +991,6 @@ div.spinner { #map-function, #reduce-function{ width: 100%; - height: 300px; font-size: 16px; } |