Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function afterLoad(theme) {
if (_self.$theme)
dom.removeCssClass(_self.container, _self.$theme);
_self.$theme = theme ? theme.cssClass : null;
if (_self.$theme)
dom.addCssClass(_self.container, _self.$theme);
// force re-measure of the gutter width
if (_self.$size) {
_self.$size.width = 0;
_self.onResize();
}
}
};
var hint = '';
if (this.element.value.length !== 0) {
hint += display.message;
if (display.predictions && display.predictions.length > 0) {
hint += ': [ ';
display.predictions.forEach(function(prediction) {
hint += (prediction.name ? prediction.name : prediction);
hint += ' | ';
}, this);
hint = hint.replace(/\| $/, ']');
}
}
this.hinter.innerHTML = hint;
if (hint.length === 0) {
dom.addCssClass(this.hinter, 'cptNoPopup');
}
else {
dom.removeCssClass(this.hinter, 'cptNoPopup');
}
this.isUpdating = false;
},
var distance = self.$distance(pageX, pageY, mousePageX, mousePageY);
var time = (new Date()).getTime();
if (distance > DRAG_OFFSET) {
state = STATE_SELECT;
var cursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY);
cursor.row = Math.max(0, Math.min(cursor.row, editor.session.getLength()-1));
onStartSelect(cursor);
} else if ((time - mousedownTime) > DRAG_TIMER) {
state = STATE_DRAG;
dragRange = editor.getSelectionRange();
var style = editor.getSelectionStyle();
dragSelectionMarker = editor.session.addMarker(dragRange, "ace_selection", style);
editor.clearSelection();
dom.addCssClass(editor.container, "ace_dragging");
}
}
if (state == STATE_DRAG)
onDragSelectionInterval();
else if (state == STATE_SELECT)
onUpdateSelectionInterval();
};
event.addListener(input, "focus", function() {
dom.addCssClass(this.output, "cptFocusPopup");
dom.addCssClass(this.hinter, "cptFocusPopup");
}.bind(this));
this.setStyle = function setStyle(style) {
dom.addCssClass(this.container, style)
};
hideOutput: function(ev) {
this.output.style.display = 'none';
dom.addCssClass(this.hide, 'cmd_hidden');
dom.removeCssClass(this.show, 'cmd_hidden');
event.stopPropagation(ev);
},
event.addListener(input, "focus", function() {
dom.addCssClass(this.output, "cptFocusPopup");
dom.addCssClass(this.hinter, "cptFocusPopup");
}.bind(this));
showOutput: function(ev) {
this.output.style.display = 'block';
dom.removeCssClass(this.hide, 'cmd_hidden');
dom.addCssClass(this.show, 'cmd_hidden');
event.stopPropagation(ev);
},
this.setStyle = function setStyle(style) {
dom.addCssClass(this.container, style)
};
this.visualizeFocus = function() {
dom.addCssClass(this.container, "ace_focus");
};