Skip to content

Commit 00cdea5

Browse files
committed
spectrum 1.8.0
1 parent 8006fc5 commit 00cdea5

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p>spectrum is licened under the <a href="https://github.com/bgrins/spectrum/blob/1.7.1/LICENSE">MIT License</a>.</p>
1+
<p>spectrum is licened under the <a href="https://github.com/bgrins/spectrum/blob/1.8.0/LICENSE">MIT License</a>.</p>

spectrum_1.7.1/spectrum.css renamed to spectrum_1.8.0/spectrum.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***
2-
Spectrum Colorpicker v1.7.1
2+
Spectrum Colorpicker v1.8.0
33
https://github.com/bgrins/spectrum
44
Author: Brian Grinstead
55
License: MIT

spectrum_1.7.1/spectrum.dnn renamed to spectrum_1.8.0/spectrum.dnn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<dotnetnuke type="Package" version="5.0">
22
<packages>
3-
<package name="spectrum" type="JavaScript_Library" version="1.7.1">
3+
<package name="spectrum" type="JavaScript_Library" version="1.8.0">
44
<friendlyName>Spectrum</friendlyName>
55
<description>The No Hassle JavaScript Colorpicker</description>
66
<owner>
@@ -21,7 +21,7 @@
2121
<libraryName>spectrum</libraryName>
2222
<fileName>spectrum.js</fileName>
2323
<preferredScriptLocation>BodyBottom</preferredScriptLocation>
24-
<CDNPath>https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.7.1/spectrum.min.js</CDNPath>
24+
<CDNPath>https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js</CDNPath>
2525
<objectName>jQuery.fn.spectrum</objectName>
2626
</javaScriptLibrary>
2727
</component>

spectrum_1.7.1/spectrum.js renamed to spectrum_1.8.0/spectrum.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Spectrum Colorpicker v1.7.1
1+
// Spectrum Colorpicker v1.8.0
22
// https://github.com/bgrins/spectrum
33
// Author: Brian Grinstead
44
// License: MIT
@@ -10,7 +10,7 @@
1010
define(['jquery'], factory);
1111
}
1212
else if (typeof exports == "object" && typeof module == "object") { // CommonJS
13-
module.exports = factory;
13+
module.exports = factory(require('jquery'));
1414
}
1515
else { // Browser
1616
factory(jQuery);
@@ -234,8 +234,7 @@
234234
previewElement = replacer.find(".sp-preview-inner"),
235235
initialColor = opts.color || (isInput && boundElement.val()),
236236
colorOnShow = false,
237-
preferredFormat = opts.preferredFormat,
238-
currentPreferredFormat = preferredFormat,
237+
currentPreferredFormat = opts.preferredFormat,
239238
clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange,
240239
isEmpty = !initialColor,
241240
allowEmpty = opts.allowEmpty && !isInputTypeColor;
@@ -443,7 +442,7 @@
443442
// In case color was black - update the preview UI and set the format
444443
// since the set function will not run (default color is black).
445444
updateUI();
446-
currentPreferredFormat = preferredFormat || tinycolor(initialColor).format;
445+
currentPreferredFormat = opts.preferredFormat || tinycolor(initialColor).format;
447446

448447
addColorToSelectionPalette(initialColor);
449448
}
@@ -705,7 +704,7 @@
705704
updateUI();
706705

707706
if (newColor && newColor.isValid() && !ignoreFormatChange) {
708-
currentPreferredFormat = preferredFormat || newColor.getFormat();
707+
currentPreferredFormat = opts.preferredFormat || newColor.getFormat();
709708
}
710709
}
711710

@@ -878,6 +877,9 @@
878877
}
879878

880879
function reflow() {
880+
if (!visible) {
881+
return; // Calculations would be useless and wouldn't be reliable anyways
882+
}
881883
dragWidth = dragger.width();
882884
dragHeight = dragger.height();
883885
dragHelperHeight = dragHelper.height();
@@ -922,6 +924,10 @@
922924
}
923925

924926
opts[optionName] = optionValue;
927+
928+
if (optionName === "preferredFormat") {
929+
currentPreferredFormat = opts.preferredFormat;
930+
}
925931
applyOptions();
926932
}
927933

0 commit comments

Comments
 (0)