Skip to content

Commit

Permalink
improved repositionToolbar speed by storing currentSection
Browse files Browse the repository at this point in the history
fixed default setting for option 'show borders'
  • Loading branch information
root committed Aug 30, 2015
1 parent bc961b2 commit a35101b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/widgets/vedor/editor.v9.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function init() {
updateHtmlContext();

addBordersStyleSheet(vdEditDoc);
VD_DETAILS_onclick(getOption('borders'));
VD_DETAILS_onclick(getOption('borders')!==false);
if ( vdEditDoc ) {
vdEditDoc.documentElement.classList.add('vedor-editor');
vdEditDoc.body.classList.add('vedor-editor');
Expand Down Expand Up @@ -2848,7 +2848,9 @@ function getToolbarPosition(sel) {

function repositionToolbar() {
var sel = vdSelectionState.get();
var currentContext = getVedorEditorContext();
if ( !currentContext ) {
currentContext = getVedorEditorContext();
}
var activeSection = document.getElementById(currentContext);
var pos = getToolbarPosition(sel);
if ( !pos || !activeSection ) {
Expand Down Expand Up @@ -2926,8 +2928,9 @@ function hideToolbar(clearFooter) {
}
}

var currentContext = '';
function showVedorEditorContext() {
var currentContext = getVedorEditorContext();
currentContext = getVedorEditorContext();

var sections = document.querySelectorAll("section.vedor-section");
for (var i=0; i<sections.length; i++) {
Expand Down

0 comments on commit a35101b

Please sign in to comment.