Skip to content

Commit

Permalink
Item14288: reworked height calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Apr 26, 2017
1 parent 26605dc commit 78b890d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Expand Up @@ -1204,23 +1204,18 @@ $.NatEditor.prototype.fixHeight = function() {
var self = this,
elem = self.engine.getWrapperElement(),
windowHeight = $(window).height() || window.innerHeight,
newHeight, bottomHeight;
tabElem = $(".jqTabContents"),
newHeight;

if (!elem || !elem.length) {
return;
}

if (self.container.is(".ui-natedit-fullscreen")) {
bottomHeight = parseInt(self.container.css('padding-bottom'), 10) * 2;
} else {
if (typeof(self.bottomHeight) === 'undefined') {
self.bottomHeight = $('.natEditBottomBar').outerHeight(true) + parseInt($('.jqTabContents').css('padding-bottom'), 10) * 2 + 2;
}
bottomHeight = self.bottomHeight;
}

//console.log("windowHeight=",windowHeight,"elem=",elem[0],"top=",elem.offset().top,"bottomHeight=",bottomHeight);
newHeight = windowHeight - elem.offset().top - bottomHeight - parseInt(elem.css('padding-bottom'), 10) *2 - 2;
newHeight = windowHeight
- elem.offset().top
- $('.natEditBottomBar').outerHeight(true)
- (tabElem.outerHeight(true) - tabElem.height())
- 2;

if (self.opts.minHeight && newHeight < self.opts.minHeight) {
newHeight = self.opts.minHeight;
Expand Down
11 changes: 8 additions & 3 deletions NatEditPlugin/pub/System/NatEditPlugin/styles.uncompressed.css
Expand Up @@ -62,7 +62,7 @@
}

.ui-natedit-buttons.foswikiRight {
margin-right:0;
margin-right:1px;
margin-left:0.7em;
margin-bottom:0.7em;
}
Expand Down Expand Up @@ -212,8 +212,13 @@

/* bottom bar on save screen */
.natEditBottomBar {
margin-top:10px;
margin-bottom:10px;
position:fixed;
width:100%;
bottom:0;
left:0;
padding:0.5em 1em 1.5em;
background:#fff;
z-index:999;
}
.natEditBottomBar ul {
margin:0px;
Expand Down
4 changes: 2 additions & 2 deletions NatEditPlugin/templates/edit.natedit.tmpl
Expand Up @@ -51,7 +51,7 @@
<input type="hidden" name="editaction" value="%IF{"$'action'='form'" then="form" else=""}%" />
<input type="hidden" name="action_save" value="" />%TMPL:END%

%TMPL:DEF{"textarea"}%<textarea id="topic" rows="25" cols="80" style='width:100%' class="foswikiTextarea foswikiWysiwygEdit natedit" data-rest-params="?%NONCE%" data-auto-max-expand="true" data-min-height="230" data-show-fullscreen="true" %TMPL:P{"natedit::options"}% name="text">%TEXT%</textarea>%TMPL:END%
%TMPL:DEF{"textarea"}%<textarea id="topic" rows="25" cols="80" style='width:100%' class="foswikiTextarea foswikiWysiwygEdit natedit" data-rest-params="?%NONCE%" data-auto-max-expand="true" data-show-fullscreen="true" %TMPL:P{"natedit::options"}% name="text">%TEXT%</textarea>%TMPL:END%

%TMPL:DEF{"formend"}%</form></div>%TMPL:END%

Expand All @@ -67,7 +67,7 @@
%TMPL:P{"help"}%
%TMPL:END%

%TMPL:DEF{"tabpane"}%%TABPANE{automaxexpand="on" minheight="330" animate="on" select="%URLPARAM{"natedittab" default="%TMPL:P{"selectedtab"}%"}%"}%
%TMPL:DEF{"tabpane"}%%TABPANE{automaxexpand="on" animate="on" select="%URLPARAM{"natedittab" default="%TMPL:P{"selectedtab"}%"}%"}%
%TMPL:P{"tabs"}%%ENDTABPANE%%TMPL:END%

%TMPL:DEF{"tabs"}%%TMPL:P{"firsttab"}%%TMPL:P{"formfields"}%%TMPL:P{"settingstab"}%%TMPL:P{"permissionstab"}%%TMPL:P{"helptab"}%%TMPL:END%
Expand Down
2 changes: 1 addition & 1 deletion NatEditPlugin/templates/editdialog.natedit.tmpl
Expand Up @@ -79,7 +79,7 @@
</tr>
<tr>
<th>%MAKETEXT{"Image"}%</th>
<td><select name='file' class='natEditAttachmentSelector foswikiSelect' data-selection="{{:file}}" data-filter="\.(png|jpe?g|gif|svg|bmp|svg)$"><option></option></select>
<td><select name='file' class='natEditAttachmentSelector foswikiSelect' data-selection="{{:file}}" data-filter="\.(png|jpe?g|gif|svg|bmp|webp|svg)$"><option></option></select>
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion NatEditPlugin/templates/settings.natedit.tmpl
Expand Up @@ -14,7 +14,7 @@
<input type="hidden" name="originalrev" value="%ORIGINALREV%" />
%JQREQUIRE{"focus, natedit, blockui"}%%TABPANE%
%TAB{"%MAKETEXT{"Preferences"}%"}%
<textarea class="foswikiTextArea natedit" name="text" id="topic" style='width:100%' wrap="virtual" data-auto-max-expand="true" data-min-height="230" %TMPL:P{"natedit::options"}%>%TEXT%</textarea>
<textarea class="foswikiTextArea natedit" name="text" id="topic" style='width:100%' wrap="virtual" data-auto-max-expand="true" %TMPL:P{"natedit::options"}%>%TEXT%</textarea>
%ENDTAB%
%TMPL:P{"helptab"}%%ENDTABPANE%
%TMPL:P{"bottomtopicactions"}%</form></div>%TMPL:END%
Expand Down

0 comments on commit 78b890d

Please sign in to comment.