Properly allow for ext-grid showGrid default setting
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2805 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -127,6 +127,13 @@ svgEditor.addExtension('view_grid', function() { 'use strict';
|
||||
svgCanvas.setHref(gridimg, datauri);
|
||||
}
|
||||
|
||||
function gridUpdate () {
|
||||
if (showGrid) {
|
||||
updateGrid(svgCanvas.getZoom());
|
||||
}
|
||||
$('#canvasGrid').toggle(showGrid);
|
||||
$('#view_grid').toggleClass('push_button_pressed tool_button');
|
||||
}
|
||||
return {
|
||||
name: 'view_grid',
|
||||
svgicons: svgEditor.curConfig.extPath + 'grid-icon.xml',
|
||||
@@ -134,7 +141,11 @@ svgEditor.addExtension('view_grid', function() { 'use strict';
|
||||
zoomChanged: function(zoom) {
|
||||
if (showGrid) {updateGrid(zoom);}
|
||||
},
|
||||
|
||||
callback: function () {
|
||||
if (showGrid) {
|
||||
gridUpdate();
|
||||
}
|
||||
},
|
||||
buttons: [{
|
||||
id: 'view_grid',
|
||||
type: 'context',
|
||||
@@ -143,11 +154,7 @@ svgEditor.addExtension('view_grid', function() { 'use strict';
|
||||
events: {
|
||||
click: function() {
|
||||
svgEditor.curConfig.showGrid = showGrid = !showGrid;
|
||||
if (showGrid) {
|
||||
updateGrid(svgCanvas.getZoom());
|
||||
}
|
||||
$('#canvasGrid').toggle(showGrid);
|
||||
$('#view_grid').toggleClass('push_button_pressed tool_button');
|
||||
gridUpdate();
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
||||
@@ -2553,10 +2553,10 @@ TODOS
|
||||
html = '<label' + cont_id + '>'
|
||||
+ '<select id="' + tool.id + '">';
|
||||
$.each(tool.options, function(val, text) {
|
||||
var sel = (val == tool.defval) ? " selected":"";
|
||||
var sel = (val == tool.defval) ? ' selected' : '';
|
||||
html += '<option value="'+val+'"' + sel + '>' + text + '</option>';
|
||||
});
|
||||
html += "</select></label>";
|
||||
html += '</select></label>';
|
||||
// Creates the tool, hides & adds it, returns the select element
|
||||
var sel = $(html).appendTo(panel).find('select');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user