Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-track-height

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-track-height

Watch an element for the min or/and max height then save it for use somewhere else

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Angular Track Height

Watch an element for the min or/and max height then save it for use somewhere else

Mostly to avoid flicker on ui-view/ng-view when it changes height.

Install

Bower

$ bower install angular-track-height --save

NPM

$ npm install angular-track-height --save

Requires requestAnimationFrame

Usage

Directives

track-height

Tracks the height of an element for usage somewhere else, like inside a controller or inside other directives.

<div track-height="{{ ctrl.nameit }}" class="some-element" ui-view=""></div>
track-height-apply

You can set the min and max, depending on the options you pass to it.

By passing "min", the min-height will be set to the mininum value the element ever had (can be 0)

By passing "max", the min-height will be set to the max value the element ever had

By passing "min max", the height will be set to the max value the element ever had (might have problems with heavily responsive elements)

<div track-height="nameit" track-height-apply="min max" class="some-element" ui-view=""></div>

Service

TrackHeight

You can access your element height using this service, by the name you provide

.get

Gets the min or max height of an element

.set

Programatically sets the min or max height of an element

angular
.module('App', [
  'TrackHeight'
])
.controller('yourcontroller', ['TrackHeight', function(TrackHeight){
  var heights = TrackHeight.get('nameit');
  // heights.min / heights.max / heights.current;
  TrackHeight.set('nameit', {
    min: 10,
    max: 100,
    current: 50
  });
});

License

MIT

Keywords

FAQs

Package last updated on 20 Aug 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc