Commit 98acd3acd9faeb8d9d78736601394ec0a82b6391

Authored by DANG
1 parent c9d8b2fe3d
Exists in master and in 1 other branch develop

Change text

Showing 3 changed files with 24 additions and 1 deletions Side-by-side Diff

app/scripts/controllers/tshirtdesign.js
... ... @@ -85,6 +85,16 @@
85 85 ];
86 86  
87 87  
  88 + //Design text
  89 + $scope.inputText = function(e) {
  90 + var text = e;
  91 + var iText = new fabric.IText(text);
  92 + canvas.add(iText);
  93 + canvas.renderAll();
  94 + canvas.setActiveObject(iText);
  95 + }
  96 +
  97 +
88 98 });
89 99 });
app/views/design_part/text.html
  1 +<li>
  2 + <div class="title">
  3 + <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
  4 + Text
  5 + </div>
  6 + <div class="content clearfix">
  7 + <input type="text" class="form-control" ng-keyup="inputText(design_text)" ng-model="design_text">
  8 + </div>
  9 +</li>
app/views/tshirt-design.html
... ... @@ -10,7 +10,7 @@
10 10 <div class="modal-body">
11 11 <header class="clearfix">
12 12 <ul class="nav pull-left">
13   - <li ng-class="{'active': isShowLeftPanel=='default'}" ng-click="showIllustration('default')">
  13 + <li ng-class="{'active': isShowLeftPanel=='text'}" ng-click="showIllustration('text')">
14 14 <i class="fa fa-jpy" aria-hidden="true"></i> 文字
15 15 </li>
16 16 <li ng-class="{'active': isShowLeftPanel=='illustration'}" ng-click="showIllustration('illustration')">
... ... @@ -139,6 +139,10 @@
139 139  
140 140 </div>
141 141 </li>
  142 + </ul>
  143 +
  144 + <!-- Text design-->
  145 + <ul id="choice-text" ng-show="isShowLeftPanel=='text'" ng-include="'views/design_part/text.html'">
142 146 </ul>
143 147 </div>
144 148 <div class="design-content col-xs-8">