Commit 39a1e279b113ce1fbfd708a99fc3f4ae099c91d4
1 parent
ee675eec19
Exists in
master
and in
1 other branch
update
Showing 2 changed files with 8 additions and 10 deletions Side-by-side Diff
app/index.html
app/scripts/controllers/tshirtdesign.js
| ... | ... | @@ -12,10 +12,12 @@ |
| 12 | 12 | var _contentCanvasWidth = _windowWidth-70; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - | |
| 15 | + console.log(canvas); | |
| 16 | 16 | canvas.setWidth(_contentCanvasWidth); |
| 17 | 17 | canvas.setHeight(650); |
| 18 | - | |
| 18 | + canvas._onMouseDown = function () { | |
| 19 | + alert('in mouse up'); | |
| 20 | + }; | |
| 19 | 21 | //Custom control |
| 20 | 22 | fabric.Object.prototype.transparentCorners = false; |
| 21 | 23 | fabric.Object.prototype.hasRotatingPoint = false; |
| ... | ... | @@ -38,7 +40,7 @@ |
| 38 | 40 | cornerPadding: 6 |
| 39 | 41 | }, |
| 40 | 42 | mt: { |
| 41 | - icon: 'images/control-icon/trash.png' | |
| 43 | + icon: 'images/control-icon/ok.png' | |
| 42 | 44 | }, |
| 43 | 45 | br: { |
| 44 | 46 | icon: 'images/control-icon/resize.png' |
| ... | ... | @@ -52,12 +54,7 @@ |
| 52 | 54 | mt: { |
| 53 | 55 | cursor: 'pointer', |
| 54 | 56 | action: function(e, target) { |
| 55 | - if(confirm('削除してもよろしいですか?')) { | |
| 56 | - if (canvas.getActiveObject()) { | |
| 57 | - canvas.remove(canvas.getActiveObject()); | |
| 58 | - } | |
| 59 | - canvas.renderAll(); | |
| 60 | - } | |
| 57 | + canvas.deactivateAll().renderAll(); | |
| 61 | 58 | } |
| 62 | 59 | }, |
| 63 | 60 | br: { |
| ... | ... | @@ -258,6 +255,7 @@ |
| 258 | 255 | |
| 259 | 256 | function onObjectSelected(options) { |
| 260 | 257 | var currentObj = options.target; |
| 258 | + | |
| 261 | 259 | |
| 262 | 260 | $scope.typeObject = currentObj.type; |
| 263 | 261 | switch ($scope.typeObject) { |