summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-02-21 14:01:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-02-21 14:01:24 +0100
commit27ad69eea586d30153b4b68328e7b938e7912f60 (patch)
tree7f325e50c1fb46a5360f2e5e026b91af97d55ba6 /core/js
parentf19276f7bc5fa74dff749112fffd350dad662148 (diff)
parent9f0fc30251fbcf0d2a75f91aa8be606e39297fa4 (diff)
downloadnextcloud-server-27ad69eea586d30153b4b68328e7b938e7912f60.tar.gz
nextcloud-server-27ad69eea586d30153b4b68328e7b938e7912f60.zip
Merge branch 'master' into no-css-js-delivery-via-php
Diffstat (limited to 'core/js')
-rw-r--r--core/js/avatar.js9
-rw-r--r--core/js/jquery.avatar.js10
-rw-r--r--core/js/js.js4
3 files changed, 20 insertions, 3 deletions
diff --git a/core/js/avatar.js b/core/js/avatar.js
index c54c4068768..67d6b9b7b95 100644
--- a/core/js/avatar.js
+++ b/core/js/avatar.js
@@ -1,6 +1,13 @@
$(document).ready(function(){
if (OC.currentUser) {
- $('#header .avatardiv').avatar(OC.currentUser, 32, undefined, true);
+ var callback = function() {
+ // do not show display name on mobile when profile picture is present
+ if($('#header .avatardiv').children().length > 0) {
+ $('#header .avatardiv').addClass('avatardiv-shown');
+ }
+ };
+
+ $('#header .avatardiv').avatar(OC.currentUser, 32, undefined, true, callback);
// Personal settings
$('#avatar .avatardiv').avatar(OC.currentUser, 128);
}
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index 6012eccfad6..02a40c088b4 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -39,10 +39,15 @@
* This will behave like the first example, but it will hide the avatardiv, if
* it will display the default placeholder. undefined is the ie8fix from
* example 4 and can be either true, or false/undefined, to be ignored.
+ *
+ * 6. $('.avatardiv').avatar('jdoe', 128, undefined, true, callback);
+ * This will behave like the above example, but it will call the function
+ * defined in callback after the avatar is placed into the DOM.
+ *
*/
(function ($) {
- $.fn.avatar = function(user, size, ie8fix, hidedefault) {
+ $.fn.avatar = function(user, size, ie8fix, hidedefault, callback) {
if (typeof(size) === 'undefined') {
if (this.height() > 0) {
size = this.height();
@@ -91,6 +96,9 @@
$div.html('<img src="'+url+'">');
}
}
+ if(typeof callback === 'function') {
+ callback();
+ }
});
});
};
diff --git a/core/js/js.js b/core/js/js.js
index d4d2583f1e5..59d48806418 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -860,6 +860,7 @@ function initCore() {
// checkShowCredentials();
// $('input#user, input#password').keyup(checkShowCredentials);
+ // user menu
$('#settings #expand').keydown(function(event) {
if (event.which === 13 || event.which === 32) {
$('#expand').click()
@@ -872,7 +873,8 @@ function initCore() {
$('#settings #expanddiv').click(function(event){
event.stopPropagation();
});
- $(document).click(function(){//hide the settings menu when clicking outside it
+ //hide the user menu when clicking outside it
+ $(document).click(function(){
$('#settings #expanddiv').slideUp(200);
});