Exemplo n.º 1
0
 function onmousedownListener(evt) {
     if (!resizingMap.get(resizePanel)) {
         evt.preventDefault();
         var projector = getProjector(resizePanel);
         resizingMap.set(resizePanel, { width: resizePanel.width, clientX: evt.clientX });
         if (projector.document) {
             onmouseupHandle = aspect_1.on(projector.document, 'onmouseup', onmouseupListener);
             onmousemoveHandle = aspect_1.on(projector.document, 'onmousemove', onmousemoveListener);
         }
         resizePanel.invalidate();
         return true;
     }
 }
Exemplo n.º 2
0
 function setResizeListeners(resizePanel) {
     var onmouseupHandle;
     var onmousemoveHandle;
     function onmouseupListener(evt) {
         if (resizingMap.get(resizePanel)) {
             evt.preventDefault();
             resizingMap.delete(resizePanel);
             onmousemoveHandle.destroy();
             onmouseupHandle.destroy();
             resizePanel.invalidate();
             return true;
         }
     }
     function onmousemoveListener(evt) {
         var originalWidth = resizingMap.get(resizePanel);
         if (originalWidth) {
             evt.preventDefault();
             resizePanel.width = String(parseInt(originalWidth.width, 10) + evt.clientX - originalWidth.clientX) + 'px';
             return true;
         }
     }
     function onmousedownListener(evt) {
         if (!resizingMap.get(resizePanel)) {
             evt.preventDefault();
             var projector = getProjector(resizePanel);
             resizingMap.set(resizePanel, { width: resizePanel.width, clientX: evt.clientX });
             if (projector.document) {
                 onmouseupHandle = aspect_1.on(projector.document, 'onmouseup', onmouseupListener);
                 onmousemoveHandle = aspect_1.on(projector.document, 'onmousemove', onmousemoveListener);
             }
             resizePanel.invalidate();
             return true;
         }
     }
     var resizeNodeProperties = resizeNodePropertiesMap.get(resizePanel);
     var onmousedownHandle = aspect_1.on(resizeNodeProperties, 'onmousedown', onmousedownListener);
     return {
         destroy: function () {
             onmousedownHandle && onmousedownHandle.destroy();
             onmouseupHandle && onmouseupHandle.destroy();
             onmousemoveHandle && onmousemoveHandle.destroy();
         }
     };
 }