1234567891011121314151617181920212223242526272829 |
- /*
- * This file contains the JS that handles the first init of each jQuery demonstration, and also switching
- * between render modes.
- */
- jsPlumb.bind("ready", function() {
- // chrome fix.
- document.onselectstart = function () { return false; };
- // render mode
- var resetRenderMode = function(desiredMode) {
- var newMode = jsPlumb.setRenderMode(desiredMode);
- $(".rmode").removeClass("selected");
- $(".rmode[mode='" + newMode + "']").addClass("selected");
- var disableList = (newMode === jsPlumb.VML) ? ".rmode[mode='canvas'],.rmode[mode='svg']" : ".rmode[mode='vml']";
- $(disableList).attr("disabled", true);
- jsPlumbDemo.init();
- };
-
- $(".rmode").bind("click", function() {
- var desiredMode = $(this).attr("mode");
- if (jsPlumbDemo.reset) jsPlumbDemo.reset();
- jsPlumb.reset();
- resetRenderMode(desiredMode);
- });
- resetRenderMode(jsPlumb.CANVAS);
-
- });
|