Browse Source

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
pull/16/head
peterd 7 years ago
parent
commit
17987b339c
  1. 3
      Gruntfile.js
  2. 6
      color.all.min.js
  3. 9
      colorPicker.js
  4. 2
      colorPicker.js.map
  5. 6
      jQuery_implementation/jQueryColorPicker.min.js
  6. 10
      javascript_implementation/index.html
  7. 5
      javascript_implementation/jsColorPicker.min.js

3
Gruntfile.js

@ -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
File diff suppressed because it is too large
View File

9
colorPicker.js

@ -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');
}
}
}

2
colorPicker.js.map
File diff suppressed because it is too large
View File

6
jQuery_implementation/jQueryColorPicker.min.js
File diff suppressed because it is too large
View File

10
javascript_implementation/index.html

@ -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
File diff suppressed because it is too large
View File

Loading…
Cancel
Save