2016-05-25 33 views
0

Dropbox Chooserを使用してDropboxから画像をアップロード/取得するカスタム画像アップローダーを実装しています。それは動作し、イメージはテキストに挿入されますが、サイズを変更することはできません。textAngularで画像のサイズを変更できません

通常、画像の上にマウスを置くと、ポップアップのようなメニューが表示され、画像のサイズを変更するオプションが表示されます。これは起こっていない。

コードは非常にシンプルであるべきですが、どこに問題があるのか​​わかりません。

// custom button in textAngular 
$provide.decorator('taOptions', ['taRegisterTool', '$delegate', function(taRegisterTool, taOptions){     
    var that; 
    // options for the dropbox choser 
    var options = { 
     // Required. Called when a user selects an item in the Chooser. 
     success: function(files) { 
      that.$editor().wrapSelection('insertImage', files[0].link); 
     }, 
     linkType: "direct", // or "direct"  
     extensions: ['images'], 
    }; 
    taRegisterTool('DropboxChooser', { 
     iconclass: "fa fa-picture-o", 
     action: function(){ 
      // makes the editor available outside 
      that = this; 
      // launches the dropbox chooser 
      Dropbox.choose(options);     
     } 
    }); 
    // add the button to the default toolbar definition 
    taOptions.toolbar[1].push('DropboxChooser'); 
    return taOptions; 
}]); 

答えて

1

私はそれを修正しました。

taRegisterTool('insertImage', { 
     iconclass: 'fa fa-picture-o', 
     tooltiptext: taTranslations.insertImage.tooltip, 
     action: function(){ 
      //bla bla bla); 
      } 
     }, // here comes the interesting part 
     onElementSelect: { 
      element: 'img', 
      action: taToolFunctions.imgOnSelectAction 
     } 
    }); 

ので、私たちがしなければならないことは、インポートtaToolFunctionsであり、我々は同じことを行うことができます:

$provide.decorator('taOptions', ['taRegisterTool', 'taToolFunctions', '$delegate', function(taRegisterTool, taToolFunctions, taOptions){ 
ので、我々はinsertImageに、我々は次のように持っているスニペットことがわかります、元 codeを見

関連する問題