angular-elastic-grid
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "angular-elastic-grid", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ { |
@@ -40,6 +40,3 @@ /** | ||
// http://demo.phapsu.com/jquery.elastic_grid/index.php | ||
var OPTION_FILTERS = [ | ||
'popup', 'none', 'moveup', 'scaleup', | ||
'fallperspective', 'helix', 'fly', 'flip' | ||
]; | ||
var OPTION_FILTERS = ['popup', 'none', 'moveup', 'scaleup', 'fallperspective', 'helix', 'fly', 'flip']; | ||
@@ -52,3 +49,3 @@ return { | ||
items: '=', | ||
direction: '=', | ||
direction: '@', | ||
inverse: '@', | ||
@@ -72,4 +69,3 @@ speed: '@', | ||
filterEffect: function() { | ||
if (OPTION_FILTERS.indexOf(scope.filter) > -1 && angular.isDefined(scope.filter)) { return scope.filter; } | ||
if (OPTION_FILTERS.indexOf(scope.filter) > -1) { return scope.filter; } | ||
return OPTION_FILTERS[OPTION_FILTERS.indexOf('none')]; | ||
@@ -82,6 +78,28 @@ }(), | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350'], | ||
button_list: [{ title: 'Demo', url: 'http://#', new_window: '_blank' }, | ||
{ title: 'Download', url: 'http://#', new_window: '_blank' }], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test'] | ||
}, { | ||
title: 'Title 2', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title2'] | ||
}, { | ||
title: 'Title 3', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title1'] | ||
}] | ||
@@ -88,0 +106,0 @@ }); |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
!function(e){e.module("angular-elastic-grid.config",[]).value("angular-elastic-grid.config",{debug:!0}),e.module("angular-elastic-grid.directives",[]),e.module("angular-elastic-grid",["angular-elastic-grid.config","angular-elastic-grid.directives"])}(angular),angular.module("angular-elastic-grid").directive("elasticGrid",function(){var e=["popup","none","moveup","scaleup","fallperspective","helix","fly","flip"];return{template:"<div></div>",restrict:"EA",replace:!0,scope:{items:"=",direction:"=",inverse:"@",speed:"@",height:"@",delay:"@",filter:"@"},link:function(i,t,l){i.$watch(function(e){return e.items},function(l){t.elastic_grid({hoverDirection:i.direction||!0,hoverDelay:i.delay||0,hoverInverse:i.inverse||!1,expandingSpeed:i.speed||500,expandingHeight:i.height||500,filterEffect:function(){return e.indexOf(i.filter)>-1&&angular.isDefined(i.filter)?i.filter:e[e.indexOf("none")]}(),items:l||[{title:"Title 1",description:"This is a description.",thumbnail:["http://placehold.it/350x150"],large:["http://placehold.it/450x350"],button_list:[{title:"Demo",url:"http://#",new_window:"_blank"},{title:"Download",url:"http://#",new_window:"_blank"}],tags:["Test"]}]})})}}}); | ||
!function(t){t.module("angular-elastic-grid.config",[]).value("angular-elastic-grid.config",{debug:!0}),t.module("angular-elastic-grid.directives",[]),t.module("angular-elastic-grid",["angular-elastic-grid.config","angular-elastic-grid.directives"])}(angular),angular.module("angular-elastic-grid").directive("elasticGrid",function(){var t=["popup","none","moveup","scaleup","fallperspective","helix","fly","flip"];return{template:"<div></div>",restrict:"EA",replace:!0,scope:{items:"=",direction:"@",inverse:"@",speed:"@",height:"@",delay:"@",filter:"@"},link:function(e,i,l){e.$watch(function(t){return t.items},function(l){i.elastic_grid({hoverDirection:e.direction||!0,hoverDelay:e.delay||0,hoverInverse:e.inverse||!1,expandingSpeed:e.speed||500,expandingHeight:e.height||500,filterEffect:function(){return t.indexOf(e.filter)>-1?e.filter:t[t.indexOf("none")]}(),items:l||[{title:"Title 1",description:"This is a description.",thumbnail:["http://placehold.it/350x150"],large:["http://placehold.it/450x350","http://placehold.it/450x350","http://placehold.it/450x350"],button_list:[{title:"Demo",url:"http://placehold.it/450x350"},{title:"Download",url:"http://placehold.it/450x350"}],tags:["Test"]},{title:"Title 2",description:"This is a description.",thumbnail:["http://placehold.it/350x150"],large:["http://placehold.it/450x350","http://placehold.it/450x350","http://placehold.it/450x350"],button_list:[{title:"Demo",url:"http://placehold.it/450x350"},{title:"Download",url:"http://placehold.it/450x350"}],tags:["Test, Title2"]},{title:"Title 3",description:"This is a description.",thumbnail:["http://placehold.it/350x150"],large:["http://placehold.it/450x350","http://placehold.it/450x350","http://placehold.it/450x350"],button_list:[{title:"Demo",url:"http://placehold.it/450x350"},{title:"Download",url:"http://placehold.it/450x350"}],tags:["Test, Title1"]}]})})}}}); |
@@ -6,6 +6,3 @@ 'use strict'; | ||
// http://demo.phapsu.com/jquery.elastic_grid/index.php | ||
var OPTION_FILTERS = [ | ||
'popup', 'none', 'moveup', 'scaleup', | ||
'fallperspective', 'helix', 'fly', 'flip' | ||
]; | ||
var OPTION_FILTERS = ['popup', 'none', 'moveup', 'scaleup', 'fallperspective', 'helix', 'fly', 'flip']; | ||
@@ -18,3 +15,3 @@ return { | ||
items: '=', | ||
direction: '=', | ||
direction: '@', | ||
inverse: '@', | ||
@@ -38,4 +35,3 @@ speed: '@', | ||
filterEffect: function() { | ||
if (OPTION_FILTERS.indexOf(scope.filter) > -1 && angular.isDefined(scope.filter)) { return scope.filter; } | ||
if (OPTION_FILTERS.indexOf(scope.filter) > -1) { return scope.filter; } | ||
return OPTION_FILTERS[OPTION_FILTERS.indexOf('none')]; | ||
@@ -48,6 +44,28 @@ }(), | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350'], | ||
button_list: [{ title: 'Demo', url: 'http://#', new_window: '_blank' }, | ||
{ title: 'Download', url: 'http://#', new_window: '_blank' }], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test'] | ||
}, { | ||
title: 'Title 2', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title2'] | ||
}, { | ||
title: 'Title 3', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title1'] | ||
}] | ||
@@ -54,0 +72,0 @@ }); |
{ | ||
"name": "angular-elastic-grid", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Lucien Bénié", |
# angular-elastic-grid | ||
[![Build Status](https://travis-ci.org/lbenie/angular-elastic-grid.svg?branch=master)](https://travis-ci.org/lbenie/angular-elastic-grid) [![devDependency Status](https://david-dm.org/lbenie/angular-elastic-grid/dev-status.svg)](https://david-dm.org/lbenie/angular-elastic-grid#info=devDependencies) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)[![npm version](https://badge.fury.io/js/angular-elastic-grid.svg)](https://badge.fury.io/js/angular-elastic-grid)[![Bower version](https://badge.fury.io/bo/angular-elastic-grid.svg)](https://badge.fury.io/bo/angular-elastic-grid) | ||
[![Build Status](https://travis-ci.org/lbenie/angular-elastic-grid.svg?branch=master)](https://travis-ci.org/lbenie/angular-elastic-grid) [![devDependency Status](https://david-dm.org/lbenie/angular-elastic-grid/dev-status.svg)](https://david-dm.org/lbenie/angular-elastic-grid#info=devDependencies) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![version](https://img.shields.io/npm/v/angular-elastic-grid.svg)](https://www.npmjs.org/package/angular-elastic-grid) | ||
[![bower](https://img.shields.io/bower/v/angular-elastic-grid.svg)](https://badge.fury.io/bo/angular-elastic-grid) ![node](https://img.shields.io/node/v/angular-elastic-grid.svg) | ||
## Installation | ||
@@ -63,15 +66,84 @@ | ||
items must be an array. | ||
filter uses the 'none' filter if no filter is defined. | ||
Optionals: direction, speed, height, delay and inverse. | ||
```html | ||
<div elastic-grid> | ||
</div> | ||
... | ||
or | ||
... | ||
<elastic-grid></elastic-grid> | ||
... | ||
or | ||
... | ||
<elastic-grid items="[{ | ||
"title": "Title 1", | ||
"description": "This is a description.", | ||
"thumbnail": ["https://pixabay.com/en/boy-child-fun-beach-sea-colors-958457/"], | ||
"large": ["https://pixabay.com/en/christmas-santa-claus-fig-993304/"], | ||
"button_list": [{"title": "Demo", "url": "http://#"}, {"title": "Download", "url": "http://#"}], | ||
"tags": ["Test"] | ||
}]" filter="popup" direction=true speed=500 height=500 delay=0 inverse=false> </elastic-grid> | ||
title: 'Title 1', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test'] | ||
}, { | ||
title: 'Title 2', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title2'] | ||
}, { | ||
title: 'Title 3', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title1'] | ||
}]" filter="popup"></elastic-grid> | ||
... | ||
or | ||
... | ||
<elastic-grid items="[{ | ||
title: 'Title 1', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test'] | ||
}, { | ||
title: 'Title 2', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title2'] | ||
}, { | ||
title: 'Title 3', | ||
description: 'This is a description.', | ||
thumbnail: ['http://placehold.it/350x150'], | ||
large: ['http://placehold.it/450x350', 'http://placehold.it/450x350', 'http://placehold.it/450x350'], | ||
button_list: [ | ||
{ title: 'Demo', url: 'http://placehold.it/450x350'}, | ||
{ title: 'Download', url: 'http://placehold.it/450x350'} | ||
], | ||
tags: ['Test, Title1'] | ||
}]" filter="popup" direction=true speed=500 height=500 delay=0 inverse=false> </elastic-grid> | ||
... | ||
... | ||
``` | ||
@@ -78,0 +150,0 @@ |
35104
564
207