Skip to content

Commit

Permalink
fixed issue with missing media button
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Callens committed Jun 7, 2015
1 parent a575300 commit ebe0d77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<div class="btn-group btn-group-sm btn-group-format" ng-show="wysiwyg.currentView === 'editable'">
<button type="button" class="btn btn-default" ng-click="showInsertLinkModal()" title="^loc_INSERT_LINK^"><i class="fa fa-link"></i></button>
<button type="button" class="btn btn-default" ng-click="showInsertMediaModal()" title="^loc_INSERT_MEDIA^" ng-if="media"><i class="fa fa-picture-o"></i></button>
<button type="button" class="btn btn-default" ng-click="showInsertMediaModal()" title="^loc_INSERT_MEDIA^" ng-if="mediaAvailable()"><i class="fa fa-picture-o"></i></button>
<button type="button" class="btn btn-default" ng-click="insertReadMore()" title="^loc_INSERT_READ_MORE^"><i class="fa fa-compress"></i></button>
</div>

Expand Down
10 changes: 9 additions & 1 deletion public/js/angular/directives/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@
scope.insertReadMore = function() {
scope.restoreSelection();
scope.formatAction('inserthtml', '<hr class="read_more_break"></hr>');
}
};

scope.mediaAvailable = function() {
if(scope.media && scope.media instanceof Array) {
return true;
}

return false;
};

scope.showInsertMediaModal = function() {
scope.saveSelection();
Expand Down

0 comments on commit ebe0d77

Please sign in to comment.