Revert "Replace $ with jQuery"

This reverts commit 62f1fffebd.
This commit is contained in:
brantje 2016-10-07 23:50:16 +02:00
parent 2cecae28c6
commit 1976206e2c
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 34 additions and 33 deletions

View file

@ -42,6 +42,7 @@ module.exports = function (grunt) {
"forge": true,
"sjcl": true,
"jQuery": true,
"$": true,
"_": true,
"oc_requesttoken": true
}

View file

@ -26,8 +26,8 @@
'ngTagsInput',
'angularjs-datetime-picker'
])
.config(function (jQueryrouteProvider) {
jQueryrouteProvider
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/vaults.html',
controller: 'VaultCtrl'
@ -57,8 +57,8 @@
.otherwise({
redirectTo: '/'
});
}).config(['jQueryhttpProvider', function (jQueryhttpProvider) {
jQueryhttpProvider.defaults.headers.common.requesttoken = oc_requesttoken;
}).config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.headers.common.requesttoken = oc_requesttoken;
}]).config(function (localStorageServiceProvider) {
localStorageServiceProvider
.setNotify(true, true);
@ -79,39 +79,39 @@
return foundItem;
};
jQuery(document).on('click', '.undoDelete', function () {
var credential = findItemByID(jQuery(this).attr('data-item-id'));
var credential = findItemByID($(this).attr('data-item-id'));
angular.element('#app-content-wrapper').scope().recoverCredential(credential);
//Outside anglular we need jQueryapply
angular.element('#app-content-wrapper').scope().jQueryapply();
//Outside anglular we need $apply
angular.element('#app-content-wrapper').scope().$apply();
});
jQuery(document).on('click', '.undoRestore', function () {
var credential = findItemByID(jQuery(this).attr('data-item-id'));
var credential = findItemByID($(this).attr('data-item-id'));
angular.element('#app-content-wrapper').scope().deleteCredential(credential);
//Outside anglular we need jQueryapply
angular.element('#app-content-wrapper').scope().jQueryapply();
//Outside anglular we need $apply
angular.element('#app-content-wrapper').scope().$apply();
});
var adjustControlsWidth = function (r) {
if (jQuery('#controls').length) {
if ($('#controls').length) {
var controlsWidth;
// if there is a scrollbar …
if (jQuery('#app-content').get(0)) {
if (jQuery('#app-content').get(0).scrollHeight > jQuery('#app-content').height()) {
if (jQuery(window).width() > 768) {
controlsWidth = jQuery('#content').width() - jQuery('#app-navigation').width() - OC.Util.getScrollBarWidth();
if (!jQuery('#app-sidebar').hasClass('hidden') && !jQuery('#app-sidebar').hasClass('disappear')) {
controlsWidth -= jQuery('#app-sidebar').width();
if ($('#app-content').get(0)) {
if ($('#app-content').get(0).scrollHeight > $('#app-content').height()) {
if ($(window).width() > 768) {
controlsWidth = $('#content').width() - $('#app-navigation').width() - OC.Util.getScrollBarWidth();
if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) {
controlsWidth -= $('#app-sidebar').width();
}
} else {
controlsWidth = jQuery('#content').width() - OC.Util.getScrollBarWidth();
controlsWidth = $('#content').width() - OC.Util.getScrollBarWidth();
}
} else { // if there is none
if (jQuery(window).width() > 768) {
controlsWidth = jQuery('#content').width() - jQuery('#app-navigation').width();
if (!jQuery('#app-sidebar').hasClass('hidden') && !jQuery('#app-sidebar').hasClass('disappear')) {
//controlsWidth -= jQuery('#app-sidebar').width();
if ($(window).width() > 768) {
controlsWidth = $('#content').width() - $('#app-navigation').width();
if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) {
//controlsWidth -= $('#app-sidebar').width();
}
} else {
controlsWidth = jQuery('#content').width();
controlsWidth = $('#content').width();
}
}
}
@ -121,25 +121,25 @@
} else {
magic = 85;
}
jQuery('#controls').css('width', controlsWidth + magic);
jQuery('#controls').css('min-width', controlsWidth + magic);
$('#controls').css('width', controlsWidth + magic);
$('#controls').css('min-width', controlsWidth + magic);
}
};
jQuery(window).resize(_.debounce(adjustControlsWidth, 400));
$(window).resize(_.debounce(adjustControlsWidth, 400));
setTimeout(function () {
adjustControlsWidth(true);
}, 200);
//@Fack this
jQuery(document).on('click', '#app-navigation-toggle', function () {
$(document).on('click', '#app-navigation-toggle', function () {
setTimeout(function () {
if (jQuery('#app-content').css('transform').toString().indexOf('matrix') >= 0) {
jQuery('#passman-controls').css('width', 'calc( 100% - 245px)');
jQuery('#passman-controls').css('top', '0');
if ($('#app-content').css('transform').toString().indexOf('matrix') >= 0) {
$('#passman-controls').css('width', 'calc( 100% - 245px)');
$('#passman-controls').css('top', '0');
} else {
jQuery('#passman-controls').css('left', 0);
jQuery('#passman-controls').css('top', '44px');
jQuery('#passman-controls').css('width', '100%');
$('#passman-controls').css('left', 0);
$('#passman-controls').css('top', '44px');
$('#passman-controls').css('width', '100%');
}
}, 350);
});