Allowed right-click palette color picking for stroke again

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1754 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Alexis Deveria
2010-09-24 18:06:47 +00:00
parent edda8b149d
commit 5e4c2cab50
2 changed files with 8 additions and 7 deletions

View File

@@ -524,7 +524,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
</div> </div>
<div id="tools_bottom_3"> <div id="tools_bottom_3">
<div id="palette_holder" tabindex="-1"><div id="palette" title="Click to change fill color, shift-click to change stroke color"></div></div> <div id="palette_holder"><div id="palette" title="Click to change fill color, shift-click to change stroke color"></div></div>
</div> </div>
<div id="copyright"><span id="copyrightLabel">Powered by</span> <a href="http://svg-edit.googlecode.com/" target="_blank">SVG-edit v2.6-preAlpha</a></div> <div id="copyright"><span id="copyrightLabel">Powered by</span> <a href="http://svg-edit.googlecode.com/" target="_blank">SVG-edit v2.6-preAlpha</a></div>
</div> </div>

View File

@@ -1794,11 +1794,12 @@
var inp = $('<input type="hidden">'); var inp = $('<input type="hidden">');
$(this).append(inp); $(this).append(inp);
inp.focus().remove(); inp.focus().remove();
}); })
$('.palette_item').click(function(evt){ $('.palette_item').mousedown(function(evt){
var picker = (evt.shiftKey ? "stroke" : "fill"); var right_click = evt.button === 2;
var id = (evt.shiftKey ? '#stroke_' : '#fill_'); var picker = ((evt.shiftKey || right_click) ? "stroke" : "fill");
var id = ((evt.shiftKey || right_click) ? '#stroke_' : '#fill_');
var color = $(this).attr('data-rgb'); var color = $(this).attr('data-rgb');
var rectbox = document.getElementById("gradbox_"+picker).parentNode.firstChild; var rectbox = document.getElementById("gradbox_"+picker).parentNode.firstChild;
var paint = null; var paint = null;
@@ -1833,7 +1834,7 @@
} }
} }
updateToolButtonState(); updateToolButtonState();
}); }).bind('contextmenu', function(e) {e.preventDefault()});
$("#toggle_stroke_tools").toggle(function() { $("#toggle_stroke_tools").toggle(function() {
$(".stroke_tool").css('display','table-cell'); $(".stroke_tool").css('display','table-cell');