mirror of
https://github.com/viliusle/miniPaint.git
synced 2026-02-06 15:16:44 +00:00
default tool update - saved for next session
This commit is contained in:
parent
f4efd6a1c1
commit
ea3f02901e
10
js/gui.js
10
js/gui.js
@ -65,12 +65,17 @@ function GUI_CLASS() {
|
||||
var COLOR_copy;
|
||||
|
||||
this.draw_helpers = function () {
|
||||
var active_tool = HELPER.getCookie('active_tool');
|
||||
if(active_tool == '')
|
||||
active_tool = DRAW.active_tool;
|
||||
DRAW.active_tool = active_tool;
|
||||
|
||||
//left menu
|
||||
var html = '';
|
||||
for (var i in DRAW_TOOLS_CONFIG) {
|
||||
html += '<a title="' + DRAW_TOOLS_CONFIG[i].title + '"';
|
||||
html += ' style="background: #989898 url(\'img/' + DRAW_TOOLS_CONFIG[i].icon[0] + '\') no-repeat ' + DRAW_TOOLS_CONFIG[i].icon[1] + 'px ' + DRAW_TOOLS_CONFIG[i].icon[2] + 'px;"';
|
||||
if (DRAW_TOOLS_CONFIG[i].name == DRAW.active_tool)
|
||||
if (DRAW_TOOLS_CONFIG[i].name == active_tool)
|
||||
html += ' class="active trn"';
|
||||
else
|
||||
html += ' class="trn"';
|
||||
@ -459,6 +464,9 @@ function GUI_CLASS() {
|
||||
DRAW.active_tool = key;
|
||||
document.getElementById(key).className = "active trn";
|
||||
this.show_action_attributes();
|
||||
|
||||
//save for next session
|
||||
HELPER.setCookie('active_tool', key);
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
@ -36,6 +36,7 @@ function MAIN_CLASS() {
|
||||
document.getElementById("rgb_b").value = color_rgb.b;
|
||||
document.getElementById("rgb_a").value = ALPHA;
|
||||
GUI.redraw_preview();
|
||||
GUI.show_action_attributes();
|
||||
|
||||
//detect color support
|
||||
if (HELPER.chech_input_color_support('main_color') == true)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user