Skip to content

Commit 57ee4ee

Browse files
committed
fix: adds missing build
1 parent 9c631dc commit 57ee4ee

7 files changed

+7
-39
lines changed

build/raty.amd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/raty.commonjs.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/raty.js

+1-33
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class Raty {
5858
this.scoreField.removeAttribute('value');
5959
}
6060
}
61-
6261
click(score) {
6362
if (!this._isReadOnly()) {
6463
score = this._adjustedScore(score);
@@ -69,7 +68,6 @@ class Raty {
6968
this._target(score);
7069
}
7170
}
72-
7371
move(score) {
7472
var integer = parseInt(score, 10);
7573
var decimal = this._getDecimal(score, 1);
@@ -87,7 +85,6 @@ class Raty {
8785
star.dispatchEvent(evt);
8886
this.isMove = false;
8987
}
90-
9188
readOnly(readonly) {
9289
if (this._isReadOnly() !== readonly) {
9390
if (readonly) {
@@ -144,7 +141,6 @@ class Raty {
144141
}
145142
return this;
146143
}
147-
148144
_adjustedScore(score) {
149145
if (score || score === 0) {
150146
return this._between(score, 0, this.opt.number);
@@ -187,7 +183,6 @@ class Raty {
187183
this.opt[replaces[i]] = this.opt[replaces[i]].replace('.', '-');
188184
}
189185
}
190-
191186
_apply(score) {
192187
this._fill(score);
193188
if (score) {
@@ -215,7 +210,6 @@ class Raty {
215210
_between(value, min, max) {
216211
return Math.min(Math.max(parseFloat(value), min), max);
217212
}
218-
219213
_binds() {
220214
if (this.cancelButton) {
221215
this._bindOverCancel();
@@ -226,7 +220,6 @@ class Raty {
226220
this._bindClick();
227221
this._bindOut();
228222
}
229-
230223
_bindClick() {
231224
this.stars.forEach(value => {
232225
value.addEventListener('click', evt => {
@@ -247,7 +240,6 @@ class Raty {
247240
});
248241
});
249242
}
250-
251243
_bindClickCancel() {
252244
this.cancelButton.addEventListener('click', evt => {
253245
this.scoreField.removeAttribute('value');
@@ -256,7 +248,6 @@ class Raty {
256248
}
257249
});
258250
}
259-
260251
_bindOut() {
261252
this.element.addEventListener('mouseleave', evt => {
262253
const score = +this.scoreField.value || undefined;
@@ -268,7 +259,6 @@ class Raty {
268259
}
269260
});
270261
}
271-
272262
_bindOutCancel() {
273263
this.cancelButton.addEventListener('mouseleave', evt => {
274264
let icon = this.opt.cancelOff;
@@ -282,7 +272,6 @@ class Raty {
282272
}
283273
});
284274
}
285-
286275
_bindOver() {
287276
const action = this.opt.half ? 'mousemove' : 'mouseover';
288277
this.stars.forEach(value => {
@@ -301,7 +290,6 @@ class Raty {
301290
});
302291
});
303292
}
304-
305293
_bindOverCancel() {
306294
this.cancelButton.addEventListener('mouseover', evt => {
307295
if (this._isReadOnly()) {
@@ -326,15 +314,13 @@ class Raty {
326314
}
327315
});
328316
}
329-
330317
_buildScoreField() {
331318
const input = document.createElement('input');
332319
input.name = this.opt.scoreName;
333320
input.type = 'hidden';
334321
this.element.appendChild(input);
335322
return input;
336323
}
337-
338324
_createCancel() {
339325
const button = document.createElement(this.opt.starType);
340326
const icon = this.opt.path + this.opt.cancelOff;
@@ -345,7 +331,6 @@ class Raty {
345331
button.setAttribute('src', icon);
346332
} else {
347333
button.classList.add(icon);
348-
349334
button.setAttribute('data-alt', 'x');
350335
}
351336
if (this.opt.cancelPlace === 'left') {
@@ -357,7 +342,6 @@ class Raty {
357342
}
358343
this.cancelButton = button;
359344
}
360-
361345
_createScore() {
362346
this.scoreField = document.querySelector(this.opt.targetScore) || this._buildScoreField();
363347
}
@@ -375,7 +359,6 @@ class Raty {
375359
}
376360
this.stars = this.element.querySelectorAll(this.opt.starType);
377361
}
378-
379362
_error(message) {
380363
throw new Error(message);
381364
}
@@ -392,7 +375,6 @@ class Raty {
392375
}
393376
}
394377
}
395-
396378
_fill(score) {
397379
let hash = 0;
398380
if (this.opt.iconRangeSame && this.opt.iconRange) {
@@ -430,21 +412,18 @@ class Raty {
430412
}
431413
return result;
432414
}
433-
434415
_getRangeIcon(irange, turnOn) {
435416
return turnOn ? irange.on || this.opt.starOn : irange.off || this.opt.starOff;
436417
}
437-
438418
_getScoreByPosition(evt, icon) {
439419
let score = parseInt(icon.alt || icon.getAttribute('data-alt'), 10);
440420
if (this.opt.half) {
441421
const size = this._getWidth();
442-
const percent = parseFloat((evt.pageX - icon.offsetLeft) / size);
422+
const percent = parseFloat((evt.pageX - icon.getBoundingClientRect().x) / size);
443423
score = score - 1 + percent;
444424
}
445425
return score;
446426
}
447-
448427
_getHint(score, evt) {
449428
if (score !== 0 && !score) {
450429
return this.opt.noRatedMsg;
@@ -465,7 +444,6 @@ class Raty {
465444
}
466445
return hint === '' ? '' : hint || score;
467446
}
468-
469447
_getWidth() {
470448
const width = parseFloat(this.stars[0].offsetWidth) || 16;
471449
if (!width) {
@@ -478,7 +456,6 @@ class Raty {
478456
true: true
479457
}[this.element.dataset.readOnly] || false;
480458
}
481-
482459
_lock() {
483460
const hint = this._getHint(this.scoreField.value);
484461
this.element.style.pointerEvents = 'none';
@@ -495,7 +472,6 @@ class Raty {
495472
_nameForIndex(i) {
496473
return this.opt.score && this.opt.score >= i ? 'starOn' : 'starOff';
497474
}
498-
499475
_resetTitle() {
500476
for (let i = 0; i < this.opt.number; i++) {
501477
this.stars[i].title = this._getHint(i + 1);
@@ -515,7 +491,6 @@ class Raty {
515491
return acc;
516492
}, {});
517493
}
518-
519494
_roundHalfScore(score) {
520495
const integer = parseInt(score, 10);
521496
let decimal = this._getDecimal(score, 1);
@@ -524,7 +499,6 @@ class Raty {
524499
}
525500
return integer + decimal;
526501
}
527-
528502
_roundStars(score, evt) {
529503
const name = this._starName(score, evt);
530504
if (name) {
@@ -533,7 +507,6 @@ class Raty {
533507
star && this._setIcon(star, icon);
534508
}
535509
}
536-
537510
_setIcon(star, icon) {
538511
star[this.opt.starType === 'img' ? 'src' : 'className'] = this.opt.path + icon;
539512
}
@@ -543,7 +516,6 @@ class Raty {
543516
this.opt.path += '/';
544517
}
545518
}
546-
547519
_setTarget(target, score) {
548520
if (score) {
549521
score = this.opt.targetFormat.toString().replace('{score}', score);
@@ -554,7 +526,6 @@ class Raty {
554526
target.textContent = score;
555527
}
556528
}
557-
558529
_setTitle(score, evt) {
559530
if (score) {
560531
const integer = parseInt(Math.ceil(score), 10);
@@ -578,7 +549,6 @@ class Raty {
578549
}
579550
return 'starOn';
580551
}
581-
582552
_target(score, evt) {
583553
if (this.opt.target) {
584554
const target = document.querySelector(this.opt.target);
@@ -604,11 +574,9 @@ class Raty {
604574
this._setTarget(target, score);
605575
}
606576
}
607-
608577
_turnOn(i, score) {
609578
return this.opt.single ? i === score : i <= score;
610579
}
611-
612580
_unlock() {
613581
this.element.style.cursor = 'pointer';
614582
this.element.style.pointerEvents = 'auto';

build/raty.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/raty.module.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/raty.systemjs.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/raty.umd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)