mirror of https://github.com/akveo/blur-admin
refactor(common): common folder completely remove
parent
412b82fbc2
commit
b176bd33e1
|
@ -1,35 +0,0 @@
|
|||
/**
|
||||
* Change top "Daily Downloads", "Active Users" values with animation effect
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.directive('animatedChange', ['$timeout', function ($timeout) {
|
||||
return {
|
||||
link: function (scope, element) {
|
||||
$timeout(function () {
|
||||
var newValue = element.attr('new-value');
|
||||
var oldvalue = parseInt(element.html());
|
||||
|
||||
function changeValue(val) {
|
||||
$timeout(function () {
|
||||
element.html(val);
|
||||
}, 30);
|
||||
}
|
||||
|
||||
if (newValue > oldvalue) {
|
||||
for (var i = oldvalue; i <= newValue; i++) {
|
||||
changeValue(i);
|
||||
}
|
||||
} else {
|
||||
for (var j = oldvalue; j >= newValue; j--) {
|
||||
changeValue(j);
|
||||
}
|
||||
}
|
||||
$timeout(function () {
|
||||
element.next().find('i').addClass('show-arr');
|
||||
}, 500);
|
||||
}, 3500);
|
||||
}
|
||||
};
|
||||
}]);
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* Auto expand textarea field
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.directive('autoExpand', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function ($scope, elem) {
|
||||
elem.bind('keydown', function ($event) {
|
||||
var element = $event.target;
|
||||
$(element).height(0);
|
||||
var height = $(element)[0].scrollHeight;
|
||||
height = (height < 16) ? 16 : height;
|
||||
$(element).height(height);
|
||||
});
|
||||
|
||||
// Expand the textarea as soon as it is added to the DOM
|
||||
setTimeout(function () {
|
||||
var element = elem;
|
||||
$(element).height(0);
|
||||
var height = $(element)[0].scrollHeight;
|
||||
height = (height < 16) ? 16 : height;
|
||||
$(element).height(height);
|
||||
}, 0)
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,20 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
blurAdminApp.directive('autoFocus', ['$timeout', '$parse', function ($timeout, $parse) {
|
||||
return {
|
||||
link: function (scope, element, attrs) {
|
||||
var model = $parse(attrs.autoFocus);
|
||||
scope.$watch(model, function (value) {
|
||||
if (value === true) {
|
||||
$timeout(function () {
|
||||
element[0].focus();
|
||||
element[0].select();
|
||||
});
|
||||
}
|
||||
});
|
||||
element.bind('blur', function () {
|
||||
scope.$apply(model.assign(scope, false));
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
|
@ -1,10 +0,0 @@
|
|||
blurAdminApp.directive('ngFileSelect', function () {
|
||||
return {
|
||||
link: function ($scope, el) {
|
||||
el.bind('change', function (e) {
|
||||
$scope.file = (e.srcElement || e.target).files[0];
|
||||
$scope.getFile();
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* Animated load block
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.directive('zoomIn', ['$timeout', '$rootScope', function ($timeout, $rootScope) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function ($scope, elem) {
|
||||
var delay = 1000;
|
||||
|
||||
if ($rootScope.$pageLoaded) {
|
||||
delay = 100;
|
||||
}
|
||||
|
||||
$timeout(function () {
|
||||
elem.removeClass('invisible');
|
||||
elem.addClass('animated zoomIn');
|
||||
}, delay);
|
||||
}
|
||||
};
|
||||
}]);
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* Change top "Daily Downloads", "Active Users" values with animation effect
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('animatedChange', animatedChange);
|
||||
|
||||
/** @ngInject */
|
||||
function animatedChange($timeout) {
|
||||
return {
|
||||
link: function (scope, element) {
|
||||
$timeout(function () {
|
||||
var newValue = element.attr('new-value');
|
||||
var oldvalue = parseInt(element.html());
|
||||
|
||||
function changeValue(val) {
|
||||
$timeout(function () {
|
||||
element.html(val);
|
||||
}, 30);
|
||||
}
|
||||
|
||||
if (newValue > oldvalue) {
|
||||
for (var i = oldvalue; i <= newValue; i++) {
|
||||
changeValue(i);
|
||||
}
|
||||
} else {
|
||||
for (var j = oldvalue; j >= newValue; j--) {
|
||||
changeValue(j);
|
||||
}
|
||||
}
|
||||
$timeout(function () {
|
||||
element.next().find('i').addClass('show-arr');
|
||||
}, 500);
|
||||
}, 3500);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})();
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* Auto expand textarea field
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('autoExpand', autoExpand);
|
||||
|
||||
/** @ngInject */
|
||||
function autoExpand() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function ($scope, elem) {
|
||||
elem.bind('keydown', function ($event) {
|
||||
var element = $event.target;
|
||||
$(element).height(0);
|
||||
var height = $(element)[0].scrollHeight;
|
||||
height = (height < 16) ? 16 : height;
|
||||
$(element).height(height);
|
||||
});
|
||||
|
||||
// Expand the textarea as soon as it is added to the DOM
|
||||
setTimeout(function () {
|
||||
var element = elem;
|
||||
$(element).height(0);
|
||||
var height = $(element)[0].scrollHeight;
|
||||
height = (height < 16) ? 16 : height;
|
||||
$(element).height(height);
|
||||
}, 0)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})();
|
|
@ -0,0 +1,27 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('autoFocus', autoFocus);
|
||||
|
||||
/** @ngInject */
|
||||
function autoFocus($timeout, $parse) {
|
||||
return {
|
||||
link: function (scope, element, attrs) {
|
||||
var model = $parse(attrs.autoFocus);
|
||||
scope.$watch(model, function (value) {
|
||||
if (value === true) {
|
||||
$timeout(function () {
|
||||
element[0].focus();
|
||||
element[0].select();
|
||||
});
|
||||
}
|
||||
});
|
||||
element.bind('blur', function () {
|
||||
scope.$apply(model.assign(scope, false));
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})();
|
|
@ -0,0 +1,19 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('ngFileSelect', ngFileSelect);
|
||||
|
||||
/** @ngInject */
|
||||
function ngFileSelect() {
|
||||
return {
|
||||
link: function ($scope, el) {
|
||||
el.bind('change', function (e) {
|
||||
$scope.file = (e.srcElement || e.target).files[0];
|
||||
$scope.getFile();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
|
@ -1,11 +1,15 @@
|
|||
(function(blurAdminApp) {
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.directive('scrollPosition', [function () {
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('scrollPosition', scrollPosition);
|
||||
|
||||
/** @ngInject */
|
||||
function scrollPosition() {
|
||||
return {
|
||||
scope: {
|
||||
scrollPosition: '=',
|
||||
maxHeight: '=',
|
||||
maxHeight: '='
|
||||
},
|
||||
link: function (scope) {
|
||||
$(window).on('scroll', function() {
|
||||
|
@ -19,5 +23,6 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
})(blurAdminApp);
|
||||
}
|
||||
|
||||
})();
|
|
@ -1,7 +1,11 @@
|
|||
(function(blurAdminApp) {
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.directive('trackWidth', [function () {
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('trackWidth', trackWidth);
|
||||
|
||||
/** @ngInject */
|
||||
function trackWidth() {
|
||||
return {
|
||||
scope: {
|
||||
trackWidth: '=',
|
||||
|
@ -22,5 +26,6 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
})(blurAdminApp);
|
||||
}
|
||||
|
||||
})();
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Animated load block
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('BlurAdmin.theme')
|
||||
.directive('zoomIn', zoomIn);
|
||||
|
||||
/** @ngInject */
|
||||
function zoomIn($timeout, $rootScope) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function ($scope, elem) {
|
||||
var delay = 1000;
|
||||
|
||||
if ($rootScope.$pageLoaded) {
|
||||
delay = 100;
|
||||
}
|
||||
|
||||
$timeout(function () {
|
||||
elem.removeClass('invisible');
|
||||
elem.addClass('animated zoomIn');
|
||||
}, delay);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})();
|
|
@ -1,9 +1,15 @@
|
|||
(function (blurAdminApp) {
|
||||
/**
|
||||
* @author v.lugovksy
|
||||
* created on 16.12.2015
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.factory('fileReader', fileReader);
|
||||
fileReader.$inject = ['$q'];
|
||||
angular.module('BlurAdmin.theme')
|
||||
.service('fileReader', fileReader);
|
||||
|
||||
function fileReader ($q) {
|
||||
/** @ngInject */
|
||||
function fileReader($q) {
|
||||
var onLoad = function(reader, deferred, scope) {
|
||||
return function () {
|
||||
scope.$apply(function () {
|
||||
|
@ -51,5 +57,4 @@
|
|||
readAsDataUrl: readAsDataURL
|
||||
};
|
||||
}
|
||||
|
||||
}(blurAdminApp));
|
||||
})();
|
Loading…
Reference in New Issue