Skip to content

Commit

Permalink
Merge pull request #2384 from luisramos0/open_new_tab
Browse files Browse the repository at this point in the history
added directive to make links open in new tab by default in textangul…
  • Loading branch information
mkllnk authored Jul 18, 2018
2 parents 4fe1e1f + b8f1571 commit 1dbd265
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
angular.module("admin.utils").directive "textangularLinksTargetBlank", () ->
restrict: 'CA'
link: (scope, element, attrs) ->
setTimeout ->
element.find(".ta-editor").scope().defaultTagAttributes.a.target = '_blank'
, 500
2 changes: 1 addition & 1 deletion app/views/admin/enterprise_groups/_form_about.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='about'" } }
%legend {{menu.selected.label}}
= f.field_container :long_description do
%text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular',
%text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular', "textangular-links-target-blank" => true,
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]"}
!= @enterprise_group[:long_description]
2 changes: 1 addition & 1 deletion app/views/admin/enterprises/form/_about_us.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
-# ['bold', 'italics', 'underline', 'strikeThrough', 'ul', 'ol', 'redo', 'undo', 'clear'],
-# ['justifyLeft','justifyCenter','justifyRight','indent','outdent'],
-# ['html', 'insertImage', 'insertLink', 'insertVideo']
%text-angular{'ng-model' => 'Enterprise.long_description', 'id' => 'enterprise_long_description', 'name' => 'enterprise[long_description]', 'class' => 'text-angular',
%text-angular{'ng-model' => 'Enterprise.long_description', 'id' => 'enterprise_long_description', 'name' => 'enterprise[long_description]', 'class' => 'text-angular', "textangular-links-target-blank" => true,
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]",
'placeholder' => t('.desc_long_placeholder')}
4 changes: 2 additions & 2 deletions app/views/admin/enterprises/form/_shop_preferences.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
.three.columns.alpha
= f.label "enterprise_preferred_shopfront_message", t('.shopfront_message')
.eight.columns.omega
%text-angular{'ng-model' => 'Enterprise.preferred_shopfront_message', 'id' => 'enterprise_preferred_shopfront_message', 'name' => 'enterprise[preferred_shopfront_message]', 'class' => 'text-angular',
%text-angular{'ng-model' => 'Enterprise.preferred_shopfront_message', 'id' => 'enterprise_preferred_shopfront_message', 'name' => 'enterprise[preferred_shopfront_message]', 'class' => 'text-angular', "textangular-links-target-blank" => true,
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]",
'placeholder' => t('.shopfront_message_placeholder')}
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label "enterprise_preferred_shopfront_closed_message", t('.shopfront_closed_message')
.eight.columns.omega
%text-angular{'ng-model' => 'Enterprise.preferred_shopfront_closed_message', 'id' => 'enterprise_preferred_shopfront_closed_message', 'name' => 'enterprise[preferred_shopfront_closed_message]', 'class' => 'text-angular',
%text-angular{'ng-model' => 'Enterprise.preferred_shopfront_closed_message', 'id' => 'enterprise_preferred_shopfront_closed_message', 'name' => 'enterprise[preferred_shopfront_closed_message]', 'class' => 'text-angular', "textangular-links-target-blank" => true,
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]",
'placeholder' => t('.shopfront_closed_message_placeholder')}
.row
Expand Down

0 comments on commit 1dbd265

Please sign in to comment.