diff --git a/src/app/app.js b/src/app/app.js index f35552f..5b617e9 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -1,14 +1,14 @@ 'use strict'; -var blurAdminApp = angular.module('BlurAdmin', [ +angular.module('BlurAdmin', [ 'ui.sortable', 'ui.router', 'ngTouch', - 'BlurAdmin.theme', - 'BlurAdmin.pages', 'toastr', 'smart-table', - 'ui.slimscroll' -]).config(['$urlRouterProvider', function ($urlRouterProvider) { - $urlRouterProvider.otherwise('/dashboard'); -}]); \ No newline at end of file + 'ui.slimscroll', + + 'BlurAdmin.theme', + 'BlurAdmin.pages', + 'BlurAdmin.tplSkin' +]); \ No newline at end of file diff --git a/src/app/pages/dashboard/timeline/TimelineCtrl.js b/src/app/pages/dashboard/timeline/TimelineCtrl.js new file mode 100644 index 0000000..c55eb6a --- /dev/null +++ b/src/app/pages/dashboard/timeline/TimelineCtrl.js @@ -0,0 +1,44 @@ +/** + * @author v.lugovksy + * created on 16.12.2015 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.dashboard') + .service('TimelineCtrl', TimelineCtrl); + + /** @ngInject */ + function TimelineCtrl() { + var timelineBlocks = $('.cd-timeline-block'), + offset = 0.8; + + //hide timeline blocks which are outside the viewport + hideBlocks(timelineBlocks, offset); + + //on scolling, show/animate timeline blocks when enter the viewport + $(window).on('scroll', function () { + if (!window.requestAnimationFrame) { + setTimeout(function () { + showBlocks(timelineBlocks, offset); + }, 100); + } else { + window.requestAnimationFrame(function () { + showBlocks(timelineBlocks, offset); + }); + } + }); + + function hideBlocks(blocks, offset) { + blocks.each(function () { + ( $(this).offset().top > $(window).scrollTop() + $(window).height() * offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden'); + }); + } + + function showBlocks(blocks, offset) { + blocks.each(function () { + ( $(this).offset().top <= $(window).scrollTop() + $(window).height() * offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in'); + }); + } + } +})(); \ No newline at end of file diff --git a/src/app/pages/dashboard/timeline/timeline.js b/src/app/pages/dashboard/timeline/timeline.js deleted file mode 100644 index d30982c..0000000 --- a/src/app/pages/dashboard/timeline/timeline.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -blurAdminApp.controller('timelineCtrl', [function () { - var timelineBlocks = $('.cd-timeline-block'), - offset = 0.8; - - //hide timeline blocks which are outside the viewport - hideBlocks(timelineBlocks, offset); - - //on scolling, show/animate timeline blocks when enter the viewport - $(window).on('scroll', function () { - if (!window.requestAnimationFrame) { - setTimeout(function () { - showBlocks(timelineBlocks, offset); - }, 100); - } else { - window.requestAnimationFrame(function () { - showBlocks(timelineBlocks, offset); - }); - } - }); - - function hideBlocks(blocks, offset) { - blocks.each(function () { - ( $(this).offset().top > $(window).scrollTop() + $(window).height() * offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden'); - }); - } - - function showBlocks(blocks, offset) { - blocks.each(function () { - ( $(this).offset().top <= $(window).scrollTop() + $(window).height() * offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in'); - }); - } - -}]); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/select/select.js b/src/app/pages/form/inputs/widgets/select/select.js deleted file mode 100644 index 021296a..0000000 --- a/src/app/pages/form/inputs/widgets/select/select.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -blurAdminApp.directive('selectpicker', [function() { - return { - restrict: 'A', - link: function( $scope, elem) { - $(elem).selectpicker(); - } - }; -}]); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/select/selectpicker.directive.js b/src/app/pages/form/inputs/widgets/select/selectpicker.directive.js new file mode 100644 index 0000000..83af8dc --- /dev/null +++ b/src/app/pages/form/inputs/widgets/select/selectpicker.directive.js @@ -0,0 +1,20 @@ +/** + * @author v.lugovksy + * created on 16.12.2015 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.form') + .directive('selectpicker', selectpicker); + + /** @ngInject */ + function selectpicker() { + return { + restrict: 'A', + link: function( $scope, elem) { + $(elem).selectpicker(); + } + }; + } +})(); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/switch/switch.directive.js b/src/app/pages/form/inputs/widgets/switch/switch.directive.js new file mode 100644 index 0000000..19af514 --- /dev/null +++ b/src/app/pages/form/inputs/widgets/switch/switch.directive.js @@ -0,0 +1,31 @@ +/** + * @author v.lugovksy + * created on 16.12.2015 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.form') + .service('switch', switchDirective); + + /** @ngInject */ + function switchDirective($timeout) { + return { + restrict: 'EA', + replace: true, + scope: { + ngModel: '=' + }, + template: '
', + link: function (scope, elem, attr) { + $timeout(function(){ + scope.color = attr.color; + $(elem).find('input').bootstrapSwitch({ + size: 'small', + onColor: attr.color + }); + }); + } + }; + } +})(); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/switch/switch.html b/src/app/pages/form/inputs/widgets/switch/switch.html index 7c988d6..210ff3d 100644 --- a/src/app/pages/form/inputs/widgets/switch/switch.html +++ b/src/app/pages/form/inputs/widgets/switch/switch.html @@ -1,4 +1,4 @@ -