Commit 58e5052e authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add Zoom +/- buttons.

parent 84f5635d
......@@ -22,6 +22,8 @@
<div id="tools-container"></div>
<a id="clear_all">Clear All</a>
<a id="layout_graph">Layout Graph</a>
<a id="zoom_in">Zoom +</a>
<a id="zoom_out">Zoom -</a>
</div>
</div>
<div class="twelve columns">
......
......@@ -385,6 +385,18 @@
e.preventDefault();
return false;
});
// Enable "Zoom +" button
$("#zoom_in").button().click(
function (e) {
dream_instance.zoom_in();
});
// Enable "Zoom -" button
$("#zoom_out").button().click(
function (e) {
dream_instance.zoom_out();
});
});
$("#graph_zone").hide();
......
......@@ -182,6 +182,26 @@
};
that.zoom_in = function () {
var attr_list = ['width', 'height', 'font-size', 'padding-top',
'line-height']
$.each(attr_list, function (i, j) {
$('.window').css(j,
$('.window').css(j).replace('px', '') * 1.1111 + 'px');
});
jsPlumb.repaintEverything();
};
that.zoom_out = function () {
var attr_list = ['width', 'height', 'font-size', 'padding-top',
'line-height']
$.each(attr_list, function (i, j) {
$('.window').css(j,
$('.window').css(j).replace('px', '') * 0.9 + 'px');
});
jsPlumb.repaintEverything();
};
priv.getData = function () {
return {
"nodes": priv.node_container,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment