Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.3 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.3 KB

Published on webcomponents.org

polymer-tinymce

A tinymce HTML Editor as an Polymer Element.

<polymer-tinymce on-tiny-change="onChange" id="editor"
      tinytoolbar="insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
      tinyplugins='["advlist autolink lists link image charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime media table contextmenu paste"]'>
</polymer-tinymce>

Get and set content:

<script>
    Polymer({

        is: "demo-element",

        getContent:function(){
          this.$.contentInput.value = this.$.editor.getContent();
        },

        setContent:function(){
          this.$.editor.setContent(this.$.contentInput.value);
        },

        onChange: function(e){
          // Get content
          var content = this.$.editor.getContent();

          // Do stuff ...

        }

      });
</script>

You may use shady dom in your project if you have problems initializing the editor. See here

Demo