Socket
Socket
Sign inDemoInstall

cm-resize

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cm-resize

Add a resize handle to your CodeMirror editor.


Version published
Weekly downloads
498
increased by8.73%
Maintainers
1
Install size
36.5 kB
Created
Weekly downloads
 

Readme

Source

cm-resize

Add a resize handle to your CodeMirror editor.

Based on an example by Rasmus Schultz (CodeMirror issue), with some extra options.

Demo

https://rawgit.com/Sphinxxxx/cm-resize/master/demo/index.html
https://codepen.io/Sphinxxxx/pen/dVPXdX

Getting Started

Installing
  • NPM:

    • npm install cm-resize --save
    • import cmResize from 'cm-resize';
  • ..or client-side <script>:

<script src="https://unpkg.com/cm-resize@1"></script>
Usage
var myCodeMirror = CodeMirror.fromTextArea(...);  //..or some other way to create a CodeMirror instance
cmResize(myCodeMirror);

Options

var handle = cmResize(myCodeMirror, {
    minWidth:  200,               //Minimum size of the CodeMirror editor.
    minHeight: 100,

    resizableWidth:  true,        //Which direction the editor can be resized (default: both width and height).
    resizableHeight: true,

    cssClass: 'cm-resize-handle', //CSS class to use on the *default* resize handle.
    handle:                       //An element to use as the handler instead of the default one (`cssClass` doesn't apply here).
});

FAQs

Last updated on 21 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc