Skip to content

Commit

Permalink
Fix toolbar float_start error in plots2 (#600)
Browse files Browse the repository at this point in the history
* fix toolbar float_start error in plots2

* fix syntax error

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
Co-authored-by: Sagarpreet Chadha <chadha.sagarpreet97@gmail.com>
  • Loading branch information
3 people authored Sep 1, 2020
1 parent bf2a111 commit 7fabfa6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
23 changes: 12 additions & 11 deletions dist/PublicLab.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22777,7 +22777,7 @@ module.exports = PublicLab.MainImageModule = PublicLab.Module.extend({
}

if (id) _editor.data.main_image = id;

return _module.options.url;
};

Expand Down Expand Up @@ -22903,11 +22903,11 @@ module.exports = PublicLab.MainImageModule = PublicLab.Module.extend({
_module.el.find('.progress').hide();
infoArea.textContent = '';
showImage = false;
_module.options.url = '';
_module.image.src = '';
_editor.data.has_main_image = false;
_editor.data.image_revision = '';
$('#removeFile').hide();
_module.options.url = '';
_module.image.src = '';
_editor.data.has_main_image = false;
_editor.data.image_revision = '';
$('#removeFile').hide();
};
}
}
Expand Down Expand Up @@ -23636,17 +23636,18 @@ module.exports = PublicLab.RichTextModule = PublicLab.Module.extend({

// if scrolling through the editor text area the toolbar will float
var wkC = document.getElementsByClassName("wk-commands")[0];
console.log('one2');

$(window).scroll(function() {
var textAreaRect = document
.getElementsByClassName("wk-container")[0]
var textAreaRect = $(".ple-textarea")[0]
.getBoundingClientRect();
var richAreaRect = $(".wk-wysiwyg")[0]
.getBoundingClientRect();
var footerRect = document
.getElementsByClassName("ple-footer")[0]
var footerRect = $(".ple-footer")[0]
.getBoundingClientRect().height;

if (
textAreaRect.bottom >= ((window.innerHeight || document.documentElement.clientHeight) - footerRect) && textAreaRect.top <= ((window.innerHeight || document.documentElement.clientHeight) - footerRect)
(textAreaRect.bottom || richAreaRect.bottom) >= ((window.innerHeight || document.documentElement.clientHeight) - footerRect) && (textAreaRect.top || richAreaRect.top) <= ((window.innerHeight || document.documentElement.clientHeight) - footerRect)
) {
wkC.style.position = "fixed";
wkC.style.bottom = footerRect + "px";
Expand Down
11 changes: 6 additions & 5 deletions src/modules/PublicLab.RichTextModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,18 @@ module.exports = PublicLab.RichTextModule = PublicLab.Module.extend({

// if scrolling through the editor text area the toolbar will float
var wkC = document.getElementsByClassName("wk-commands")[0];
console.log('one2');

$(window).scroll(function() {
var textAreaRect = document
.getElementsByClassName("wk-container")[0]
var textAreaRect = $(".ple-textarea")[0]
.getBoundingClientRect();
var footerRect = document
.getElementsByClassName("ple-footer")[0]
var richAreaRect = $(".wk-wysiwyg")[0]
.getBoundingClientRect();
var footerRect = $(".ple-footer")[0]
.getBoundingClientRect().height;

if (
textAreaRect.bottom >= ((window.innerHeight || document.documentElement.clientHeight) - footerRect) && textAreaRect.top <= ((window.innerHeight || document.documentElement.clientHeight) - footerRect)
(textAreaRect.bottom || richAreaRect.bottom) >= ((window.innerHeight || document.documentElement.clientHeight) - footerRect) && (textAreaRect.top || richAreaRect.top) <= ((window.innerHeight || document.documentElement.clientHeight) - footerRect)
) {
wkC.style.position = "fixed";
wkC.style.bottom = footerRect + "px";
Expand Down

0 comments on commit 7fabfa6

Please sign in to comment.