Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
var $ = require("jquery"), selectize = require("selectize"), utils = require("yasgui-utils");
selectize.define("allowRegularTextInput", function(options) {
var self = this;
this.onMouseDown = (function() {
var original = self.onMouseDown;
return function(e) {
if (!self.$dropdown.is(":visible")) {
//receiving focus via mouse click
original.apply(this, arguments);
//this is a trick to make each value editable
//a bit strange, but the only trick to avoid static values
//and, this allows copy-ing (ctrl-c) of endpoints as well now
var val = this.getValue();
this.clear(true);
this.setTextboxValue(val);
this.refreshOptions(true);