mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:33:24 +02:00
Created Packery and Draggabilly directives.
Applied the Packery directive to Info layout based on media queries.
This commit is contained in:
16
res/app/components/stf/angular-draggabilly/angular-draggabilly-directive.js
vendored
Normal file
16
res/app/components/stf/angular-draggabilly/angular-draggabilly-directive.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
module.exports = function angularDraggabillyDirective(DraggabillyService) {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
link: function (scope, element, attrs) {
|
||||
var parsedAttrs = $parse(attrs.angularDraggabilly)()
|
||||
if (typeof parsedAttrs !== 'object') {
|
||||
parsedAttrs = {}
|
||||
}
|
||||
|
||||
var options = angular.extend({
|
||||
}, parsedAttrs)
|
||||
|
||||
var draggie = new DraggabillyService(element[0], options)
|
||||
}
|
||||
}
|
||||
}
|
||||
23
res/app/components/stf/angular-draggabilly/angular-draggabilly-spec.js
vendored
Normal file
23
res/app/components/stf/angular-draggabilly/angular-draggabilly-spec.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
describe('angularDraggabilly', function () {
|
||||
|
||||
beforeEach(module('stf.angular-draggabilly'));
|
||||
|
||||
var scope, compile;
|
||||
|
||||
beforeEach(inject(function ($rootScope, $compile) {
|
||||
scope = $rootScope.$new();
|
||||
compile = $compile;
|
||||
}));
|
||||
|
||||
it('should ...', function () {
|
||||
|
||||
/*
|
||||
To test your directive, you need to create some html that would use your directive,
|
||||
send that through compile() then compare the results.
|
||||
|
||||
var element = compile('<div angular-draggabilly name="name">hi</div>')(scope);
|
||||
expect(element.text()).toBe('hello, world');
|
||||
*/
|
||||
|
||||
});
|
||||
});
|
||||
9
res/app/components/stf/angular-draggabilly/index.js
vendored
Normal file
9
res/app/components/stf/angular-draggabilly/index.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var draggabilly = require('draggabilly')
|
||||
|
||||
module.exports = angular.module('stf.angular-draggabilly', [
|
||||
|
||||
])
|
||||
.factory('DraggabillyService', function () {
|
||||
return draggabilly
|
||||
})
|
||||
.directive('angularDraggabilly', require('./angular-draggabilly-directive'))
|
||||
Reference in New Issue
Block a user