fixed formatting in panning extension

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2407 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Bruno Heridet 2013-02-16 11:21:06 +00:00
parent 6b23a26b82
commit 8c5976f488
1 changed files with 28 additions and 32 deletions

View File

@ -10,39 +10,35 @@
/* /*
This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem
*/ */
svgEditor.addExtension("ext-panning", function() {
return { svgEditor.addExtension('ext-panning', function() {
name: "Extension Panning", return {
svgicons: "extensions/ext-panning.xml", name: 'Extension Panning',
svgicons: 'extensions/ext-panning.xml',
buttons: [{ buttons: [{
id: "ext-panning", id: 'ext-panning',
type: "mode", type: 'mode',
title: "Panning", title: 'Panning',
events: { events: {
'click': function() { click: function() {
svgCanvas.setMode("ext-panning"); svgCanvas.setMode('ext-panning');
}
}
}],
mouseDown: function() {
if(svgCanvas.getMode() == "ext-panning") {
svgEditor.setPanning(true);
return {started: true};
}
},
mouseUp: function(opts) {
if(svgCanvas.getMode() == "ext-panning") {
svgEditor.setPanning(false);
return {
keep: false,
element: null
}
} }
} }
}; }],
mouseDown: function() {
if(svgCanvas.getMode() == 'ext-panning') {
svgEditor.setPanning(true);
return {started: true};
}
},
mouseUp: function() {
if(svgCanvas.getMode() == 'ext-panning') {
svgEditor.setPanning(false);
return {
keep: false,
element: null
};
}
}
};
}); });