mirror of
https://github.com/PitPik/colorPicker.git
synced 2025-09-09 09:12:42 -06:00
fixed actionCallback issue on minified files
function names on min.’s files get a short name, so _mouseMoveAction ends up with a weird name if minified and provides wrong name to actionCallback
This commit is contained in:
parent
08e4c95006
commit
17987b339c
@ -17,6 +17,9 @@ module.exports = function(grunt) {
|
||||
},{
|
||||
'jQuery_implementation/jQueryColorPicker.min.js':
|
||||
['colors.js', 'colorPicker.data.js', 'colorPicker.js','jQuery_implementation/jqColor.js']
|
||||
},{
|
||||
'javascript_implementation/jsColorPicker.min.js':
|
||||
['colors.js', 'colorPicker.data.js', 'colorPicker.js','javascript_implementation/jsColor.js']
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
6
color.all.min.js
vendored
6
color.all.min.js
vendored
File diff suppressed because one or more lines are too long
@ -33,6 +33,7 @@
|
||||
_bgTypes = {w: 'White', b: 'Black', c: 'Custom'},
|
||||
|
||||
_mouseMoveAction, // current mouseMove handler assigned on mouseDown
|
||||
_action = '', // needed for action callback; needed due to minification of javaScript
|
||||
_mainTarget, // target on mouseDown, might be parent element though...
|
||||
_valueType, // check this variable; gets missused/polutet over time
|
||||
_delayState = 1, // mouseMove offset (y-axis) in display elements // same here...
|
||||
@ -429,19 +430,24 @@
|
||||
focusInstance(THIS);
|
||||
_mainTarget = target;
|
||||
stopChange(undefined, 'resetEventListener');
|
||||
_action = ''; // needed due to minification of javaScript
|
||||
|
||||
if (target === _nodes.sldl_3 || target === _nodes.curm) {
|
||||
_mainTarget = _nodes.sldl_3;
|
||||
_mouseMoveAction = changeXYValue;
|
||||
_action = 'changeXYValue';
|
||||
changeClass(_nodes.slds, 'do-drag');
|
||||
} else if (/sldr/.test(className) || target === _nodes.curl || target === _nodes.curr) {
|
||||
_mainTarget = _nodes.sldr_4;
|
||||
_mouseMoveAction = changeZValue;
|
||||
_action = 'changeZValue';
|
||||
} else if (target === _nodes.opacity.children[0] || target === _nodes.opacity_slider) {
|
||||
_mainTarget = _nodes.opacity;
|
||||
_mouseMoveAction = changeOpacityValue;
|
||||
_action = 'changeOpacityValue';
|
||||
} else if (/-disp/.test(className) && !/HEX-/.test(className)) {
|
||||
_mouseMoveAction = changeInputValue;
|
||||
_action = 'changeInputValue';
|
||||
(target.nextSibling.nodeType === 3 ? target.nextSibling.nextSibling : target.nextSibling).
|
||||
appendChild(_nodes.nsarrow); // nextSibling for better text selection
|
||||
_valueType = className.split('-disp')[0].split('-');
|
||||
@ -454,6 +460,7 @@
|
||||
}
|
||||
_mainTarget = _nodes.resizer;
|
||||
_mouseMoveAction = resizeApp;
|
||||
_action = 'resizeApp';
|
||||
} else {
|
||||
_mouseMoveAction = undefined;
|
||||
}
|
||||
@ -548,7 +555,7 @@
|
||||
resetCursors();
|
||||
|
||||
if (_options.actionCallback) {
|
||||
_options.actionCallback(e, mouseMoveAction.name || action || 'external');
|
||||
_options.actionCallback(e, _action || mouseMoveAction.name || action || 'external');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -21,15 +21,15 @@ Calling the colorPicker on all inputs with the calssName 'color': <pre>jsColorPi
|
||||
<input class="color" value="hsla(32, 95%, 23%, 0.9)" />
|
||||
</p>
|
||||
<!-- <button onclick="$colors.colorPicker('destroy')">destroy</button> -->
|
||||
<script type="text/javascript" src="../colors.js"></script>
|
||||
<!-- <script type="text/javascript" src="../colors.js"></script>
|
||||
<script type="text/javascript" src="../colorPicker.data.js"></script>
|
||||
<script type="text/javascript" src="../colorPicker.js"></script>
|
||||
|
||||
-->
|
||||
<!-- <script type="text/javascript" src="../color.all.min.js"></script> -->
|
||||
|
||||
<script type="text/javascript" src="jsColor.js"></script>
|
||||
|
||||
<!-- <script type="text/javascript" src="jQueryColorPicker.min.js"></script> -->
|
||||
<!-- <script type="text/javascript" src="jsColor.js"></script>
|
||||
-->
|
||||
<script type="text/javascript" src="jsColorPicker.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var colors = jsColorPicker('input.color', {
|
||||
|
5
javascript_implementation/jsColorPicker.min.js
vendored
Normal file
5
javascript_implementation/jsColorPicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user