Giter VIP home page Giter VIP logo

ui-layout's Introduction

UI.Layout directive Build Status

This directive allows you to split stuff ! Holy grail demo

Requirements

  • AngularJS

Usage

You can get it from Bower

bower install angular-ui-layout\#bower
# or
bower install angular-ui-layout\#v0.0.0
# or
bower install angular-ui-layout\#src0.0.0

This will copy the UI.Layout files into a bower_components folder, along with its dependencies. Load the script files in your application:

<link rel="stylesheet" type="text/css" href="bower_components/angular-ui-layout/ui-layout.css"/>
<!-- ... -->
<script type="text/javascript" src="bower_components/raf/index.js"></script>
<script type="text/javascript" src="bower_components/angular-ui-layout/ui-layout.js"></script>

Add the UI.Layout module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['ui.layout']);

Finally, add the directive to your html:

<div ui-layout="{ flow : 'row' }"></div>
or
<ui-layout options="{ flow : 'row' }"></ui-layout>

Options

flow

Type: String Default: 'row' flow: row | column

A fake flex-direction property. It specifies how the child elements are placed in the layout container, by setting the direction of the flex container's main axis. This determines the direction that child elements are laid out in.

Child Attributes

size

Type: String

Sets the default placement of the splitbar.

pixels
<div ui-layout>
    <div size="100px"></div>
</div>

percentage
<div ui-layout>
    <div size="10%"></div>
</div>

minSize

Type: String Default: '8px'

Specifices the minimum size the child element can be set to. Defaults to the width of the splitbar if no value is provided.

pixels
<div ui-layout>
    <div min-size="100px"></div>
</div>

percentage
<div ui-layout>
    <div min-size="10%"></div>
</div>

maxSize

Type: String

Specifices the maxium size the child element can be set to.

pixels
<div ui-layout>
    <div max-size="100px"></div>
</div>

percentage
<div ui-layout>
    <div max-size="10%"></div>
</div>

Testing

We use Karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:

npm install -g gulp
npm install && bower install
gulp

The karma task will try to open Firefox and Chrome as browser in which to run the tests. Make sure this is available or change the configuration in test\karma-jqlite.conf.js and test\karma-jquery.conf.js

Some test tasks :

  • gulp karma : Will run jqlite and jquery tests in simple run mode,
  • gulp karma:jqlite:unit : Will run jqlite tests in simple run mode,
  • gulp karma:jquery:unit : Will run jquery tests in simple run mode,
  • gulp karma:jqlite:watch : Will run jqlite tests and watch for changes,
  • gulp karma:jquery:watch : Will run jquery tests and watch for changes,

** gulp serve runs and watches all**

ui-layout's People

Contributors

0x-r4bbit avatar douglasduteil avatar hamxiaoz avatar jbro-io avatar maxkorp avatar nateabele avatar peterdavehello avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.