12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- ;(function() {
- var _initialised = false;
-
- jsPlumbDemo.showConnectionInfo = function(s) {
- Y.one('#list').setContent(s);
- Y.one('#list').setStyle("display","block");
- };
-
- jsPlumbDemo.hideConnectionInfo = function() {
- Y.one('#list').setStyle("display","none");
- };
-
- jsPlumbDemo.attachBehaviour = function() {
- if (!_initialised) {
- Y.all(".hide").each(function(h) {
- h.on('click', function() {
- jsPlumb.toggle(h.get("rel"));
- });
- });
-
- Y.all(".drag").each(function(d) {
- d.on('click', function() {
- var s = jsPlumb.toggleDraggable(d.get("rel"));
- d.setContent(s ? 'disable dragging' : 'enable dragging');
- var rel = "#" + d.getAttribute("rel");
- if (!s) Y.one(rel).addClass('drag-locked');
- else Y.one(rel).removeClass('drag-locked');
- Y.one(rel).setStyle("cursor", s ? "pointer" : "default");
- });
- });
- Y.all(".detach").each(function(d) {
- d.on('click', function() {
- jsPlumb.detachAllConnections(d.getAttribute("rel"));
- });
- });
- Y.one("#clear").on('click', function() {
- jsPlumb.detachEveryConnection();
- jsPlumbDemo.showConnectionInfo("");
- });
- _initialised = true;
- }
-
- };
- })();
|