Socket
Socket
Sign inDemoInstall

angular-resizable

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-resizable

A directive for creating resizable containers in angular.


Version published
Weekly downloads
2.9K
decreased by-21.4%
Maintainers
1
Install size
15.8 kB
Created
Weekly downloads
 

Readme

Source

angular-resizable

A directive for creating resizable containers.

Why?

All other resizable directive concepts I came across include layout logic in the directive. I wanted a directive that only handled the resize logic. This way, the layout logic is quarantined to the CSS.

Usage

  1. npm install angular-resizable or bower install angular-resizable or clone/download this repo
  2. Include angular-resizable.min.js in your project.
  3. Include angular-resizable.min.css in your project as well (this provides default styling for the resize handles).
  4. Then include the module in your app: angular.module('app', ['angularResizable'])
  5. Use it: <section resizable r-directions="['bottom', 'right']" r-flex="true">

Include any sides you want to be resizable in an array inside r-directions. Accepts 'top','right','bottom', and 'left'. You can style the handles however you want. Just override the styles in the css in your own stylesheet.

Options

AttributesDefaultAcceptsDescription
rDirections['right']['top', 'right', 'bottom', 'left',]Determines which sides of the element are resizable.
rFlexfalsebooleanSet as true if you are using flexbox. See this codepen.
rCenteredXfalsebooleanIf set as true, the velocity of horizontal resizing will be doubled.
rCenteredYfalsebooleanIf set as true, the velocity of vertical resizing will be doubled.
rWidthfalseinteger or $scope variableIf set, the resizable element will be rendered with a predefined width relative to this value in pixels and a watcher will be set on the 'rWidth' attribute. See this codepen.
rHeightfalseinteger or $scope variableIf set, the resizable element will be rendered with a predefined height relative to this value in pixels and a watcher will be set on the 'rHeight' attribute. See this codepen.
rGrabber<span></span>stringDefines custom inner html for the grabber.

Events

For an example using the events, see this codepen.

angular-resizable.resizeStart

This event is emitted at the beginning of a resize with the following info object:

  • info.width : The width of the directive at time of resize start. **Will be false if resizing vertically
  • info.height : The height of the directive at time of resize start. **Will be false if resizing horizontally
  • info.id : The id of the directive. **Will be false if there is no id set.
  • info.evt : original mouse event object

angular-resizable.resizing

This event is emitted during the resizing of the element with the following object as an argument:

  • info.width : The width of the directive at time of resize end. **Will be false if resizing vertically
  • info.height : The height of the directive at time of resize end. **Will be false if resizing horizontally
  • info.id : The id of the directive. **Will be false if there is no id set.
  • info.evt : original mouse event object

angular-resizable.resizeEnd

This event is emitted at the end of a resize with the following object as an argument:

  • info.width : The width of the directive at time of resize end. **Will be false if resizing vertically
  • info.height : The height of the directive at time of resize end. **Will be false if resizing horizontally
  • info.id : The id of the directive. **Will be false if there is no id set.
  • info.evt : original mouse event object

version notes

1.2.0

  • Add angular-resizable.resizing event (see pull request #7)
  • Add attribute for providing custom inner html to the grabber element (see pull request #7)

License

MIT

Keywords

FAQs

Last updated on 26 Oct 2015

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