angular-summernote icon indicating copy to clipboard operation
angular-summernote copied to clipboard

ng-disabled

Open loykianos opened this issue 10 years ago • 17 comments

Hi there, is there a way to disable the summernote? I have tried using ng-disabled but it doesn't seem to work. Good job either way.

loykianos avatar Jul 21 '15 13:07 loykianos

Now, it isn't supported. I will consider it.

outsideris avatar Jul 22 '15 02:07 outsideris

+1

bjaraujo avatar Jan 19 '16 12:01 bjaraujo

Any updates please

chakrabandla avatar Mar 08 '16 07:03 chakrabandla

+1 would be great. Reduces a lot of boilerplate is my existing code.

martijndebruijn avatar Apr 25 '16 06:04 martijndebruijn

+1 please.

hamxabaig avatar May 10 '16 12:05 hamxabaig

+1 please

javieerrubio11 avatar Dec 12 '16 13:12 javieerrubio11

+1

robbporto avatar Jan 04 '17 20:01 robbporto

Any news on this? Or can anyone give me some pointers on how this could be implemented? The original version has this in built in to the Basic API using $('#summernote').summernote('disable'); and $('#summernote').summernote('enable'); Thanks

nicolaib avatar Jan 24 '17 21:01 nicolaib

@nicolaib instead, you can show an absolute div with z-index greater than parent. So that it acts as overlay and stops interaction to summernote. Some CSS can do this job easily ;)

hamxabaig avatar Jan 24 '17 21:01 hamxabaig

I solved it this way, which removes the possibility to change the text and images. It's also kinda hacky but better than putting a div over the textarea - I think ;-) $timeout(function(){ angular.element('.note-editable').attr('contenteditable', false); angular.element('.note-control-selection').remove(); },0); This is useful if it's needed on-the-fly.

Another solution that is also useful (and maybe better if not needed on-the-fly) is to show the editor content as trusted HTML like this: Controller: function trustedHTML(inputHTML){ return $sce.trustAsHtml(inputHTML); } View: <div ng-bind-html="$ctrl.trustedHTML($ctrl.text)"></div>

nicolaib avatar Jan 25 '17 11:01 nicolaib

@nicolaib 👍

hamxabaig avatar Jan 25 '17 11:01 hamxabaig

Waiting for this 👍

lacivert avatar Jan 31 '17 14:01 lacivert

+1

baonhan avatar May 25 '17 02:05 baonhan

You can also disable it by accessing the underlying summernote element:

$scope.init = function() {
  $timeout(function() {
    $scope.editor.summernote('disable');
  }, 0);
});
<summernote on-init="init()" editor="editor" ... ></summernote>

baonhan avatar May 25 '17 23:05 baonhan

Any updates on this?

j0131n avatar Aug 04 '17 01:08 j0131n

Any solution here ????

KamranMaqbool avatar Dec 26 '19 13:12 KamranMaqbool

#216 I've made a pull request to fix this, that workaround fixed my problem so I wanted to share.

Crzech avatar Mar 25 '20 16:03 Crzech