This is a migrated thread and some comments may be shown as answers.

Content Editable with no content

1 Answer 17 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Veteran
Steve asked on 24 Sep 2018, 06:03 PM

I'm trying to style the ":empty" state of the div, but it doesn't work because the Kendo Editor seems to add "" into the div, so it's never empty.

 

What should we do here?  If the user backspaces whatever that code is, the :empty state then appears just fine.

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 26 Sep 2018, 01:01 PM
Hi Steve,

In order to achieve the initial styling of the empty <div>, I would suggest you to set the styling on the Editor element. Later, on keyup event you could remove that style:
<div id="topEditor" style="width:800px;height:500px;background: red;"></div>
<script>
  $(document).ready(function() {
    $("#topEditor").kendoEditor({
      keyup: function(e) {
        e.sender.element.css('background', '')
      }
    });
 
  });
</script>

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
Steve
Top achievements
Rank 2
Veteran
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or