# HG changeset patch # User Ludovic Chabant # Date 1443155134 25200 # Node ID 2bad085aeff65a0ec4db86d2db6ff62be790c2dc # Parent af8802303e30f1d46f5fac432361577715be0bb6 web: Better height for edit/preview controls. diff -r af8802303e30 -r 2bad085aeff6 wikked/assets/js/wikked/edit.js --- a/wikked/assets/js/wikked/edit.js Thu Sep 24 21:01:38 2015 -0700 +++ b/wikked/assets/js/wikked/edit.js Thu Sep 24 21:25:34 2015 -0700 @@ -95,6 +95,9 @@ if (this.previewSection.is(':visible')) { // Hide the preview, restore the textbox. + this.inputCtrl.height(Math.max( + this.inputCtrl.height(), + this.previewSection.height() - 12)); this.inputSection.show(); this.previewSection.hide(); this.previewButtonLabel.html("Preview"); @@ -109,10 +112,18 @@ url: previewBtn.attr('data-wiki-url'), text: this.inputCtrl.val() }; + this.previewSection.html("

Loading...

"); + this.previewSection.height(this.inputSection.height()); + this.previewSection.show(); + this.inputSection.hide(); $.post('/api/preview', previewData) .success(function(data) { var el = $view.previewSection; + el.height('auto'); el.html(data.text); + el.height(Math.max( + el.height(), + $view.inputSection.height())); el.show(); $view.inputSection.hide(); $view.previewButtonLabel.html("Edit");