Skip to content

Commit

Permalink
bug fixes to wysiwyg
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Callens authored and Blake Callens committed Jun 10, 2015
1 parent 61f603c commit d3be2c9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions public/js/angular/directives/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
};

scope.showInsertMediaModal = function() {
angular.element(element).find('[contenteditable]').focus();
scope.saveSelection();
angular.element(element).find('[insert-media-modal]').modal('show');
};
Expand All @@ -135,12 +136,11 @@
};

scope.insertMedia = function() {
angular.element(element).find('[insert-media-modal]').modal('hide');
scope.restoreSelection();

var mediaFormat = scope.getMediaFormat();
scope.formatAction('inserthtml', '<div>^media_display_' + scope.wysiwyg.selectedMediaItem._id + mediaFormat + '^</div>');
scope.saveSelection();

angular.element(element).find('[insert-media-modal]').modal('hide');
scope.restoreSelection();
};

scope.getMediaFormat = function() {
Expand Down Expand Up @@ -240,6 +240,11 @@
return;
}

if(scope.wysiwyg.currentView === 'html') {
scope.wysiwyg.layout = scope.layout.toString();
return;
}

var self = this;

var tempEditable = angular.element(element).find('.temp_editable');
Expand Down

0 comments on commit d3be2c9

Please sign in to comment.