mirror of
https://github.com/nextcloud/passman.git
synced 2024-09-20 14:56:21 +08:00
parent
2cecae28c6
commit
1976206e2c
|
@ -42,6 +42,7 @@ module.exports = function (grunt) {
|
|||
"forge": true,
|
||||
"sjcl": true,
|
||||
"jQuery": true,
|
||||
"$": true,
|
||||
"_": true,
|
||||
"oc_requesttoken": true
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue