Skip to content

Commit

Permalink
chore: apply better code styling to few core files (#749)
Browse files Browse the repository at this point in the history
* chore: apply better code styling to few core files
  • Loading branch information
ghiscoding authored May 2, 2023
1 parent 58701c4 commit b879ca0
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 301 deletions.
19 changes: 4 additions & 15 deletions slick.compositeeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

options = Slick.Utils.extend({}, defaultOptions, options);


function getContainerBox(i) {
var c = containers[i];
var offset = Slick.Utils.offset(c);
Expand All @@ -64,7 +63,6 @@
};
}


function editor(args) {
var editors = [];

Expand Down Expand Up @@ -99,7 +97,6 @@
}, 0);
}


this.destroy = function () {
var idx = 0;
while (idx < editors.length) {
Expand All @@ -108,7 +105,7 @@
}

options.destroy && options.destroy();
editors = [];
editors = [];
};


Expand All @@ -117,7 +114,6 @@
(firstInvalidEditor || editors[0]).focus();
};


this.isValueChanged = function () {
var idx = 0;
while (idx < editors.length) {
Expand All @@ -129,7 +125,6 @@
return false;
};


this.serializeValue = function () {
var serializedValue = [];
var idx = 0;
Expand All @@ -140,7 +135,6 @@
return serializedValue;
};


this.applyValue = function (item, state) {
var idx = 0;
while (idx < editors.length) {
Expand All @@ -158,11 +152,10 @@
}
};


this.validate = function (targetElm) {
this.validate = function (target) {
var validationResults;
var errors = [];
var targetElm = targetElm ? targetElm : null;
var targetElm = target ? target : null;

firstInvalidEditor = null;

Expand Down Expand Up @@ -204,7 +197,7 @@
}
idx++;
}
targetElm = null;
targetElm = null;

if (errors.length) {
return {
Expand All @@ -220,7 +213,6 @@
}
};


this.hide = function () {
var idx = 0;
while (idx < editors.length) {
Expand All @@ -230,7 +222,6 @@
options.hide && options.hide();
};


this.show = function () {
var idx = 0;
while (idx < editors.length) {
Expand All @@ -240,12 +231,10 @@
options.show && options.show();
};


this.position = function (box) {
options.position && options.position(box);
};


init();
}

Expand Down
Loading

0 comments on commit b879ca0

Please sign in to comment.