【发布时间】:2015-01-07 10:30:29
【问题描述】:
我正在使用 JSPlumb 和 AngularJS 构建小部件列表,我需要使用每个小部件上的处理程序启用调整大小。上面已经有一个example,我已经实现了,但是没有调整大小。
这是我的代码,
HTML:
<div ng-controller="CustomWidgetCtrl" plumb-item class="item" resizeable>
App.js:
routerApp.directive('resizeable',function($compile){
return{
restrict: 'A',
link: function(scope, element, attrs){
element.resizeable({
resize : function(event, ui) {
jsPlumb.repaint(ui.helper);
},
handles: "all"
});
}
};
这里是Plunker
执行pankajparkar的代码后的输出,
我的实际小部件:
<div ng-controller="CustomWidgetCtrl" plumb-item class="item" style="margin: 20px; top: 50px; left: 110px; height: 480px; width: 400px; " ng-repeat="widget in dashboard.widgets" ng-style="{ 'left':widget.sizeX, 'top':widget.sizeY }" data-identifier="{{widget.id}}" resizeable >
【问题讨论】:
-
@NaeemShaikh 我用 plunker 修改了问题
标签: javascript jquery angularjs angularjs-directive jsplumb