Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
de850dfa
Commit
de850dfa
authored
12 years ago
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Contacts: Fix layout in contacts list that I had broken in an earlier fix :-P
parent
4c6d11e2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/contacts/css/contacts.css
+1
-2
1 addition, 2 deletions
apps/contacts/css/contacts.css
apps/contacts/js/contacts.js
+17
-17
17 additions, 17 deletions
apps/contacts/js/contacts.js
apps/contacts/templates/part.contacts.php
+1
-1
1 addition, 1 deletion
apps/contacts/templates/part.contacts.php
with
19 additions
and
20 deletions
apps/contacts/css/contacts.css
+
1
−
2
View file @
de850dfa
...
...
@@ -4,8 +4,7 @@
#leftcontent
{
top
:
3.5em
!important
;
padding
:
0
;
margin
:
0
;
}
#rightcontent
{
top
:
3.5em
!important
;
padding-top
:
5px
;
}
#contacts
{
background
:
#fff
;
width
:
20em
;
left
:
12.5em
;
top
:
3.7em
;
bottom
:
3em
;
position
:
fixed
;
overflow
:
auto
;
padding
:
0
;
margin
:
0
;
}
#contacts
li
{
height
:
28px
;
display
:
block
;
margin
:
0
0
0
5px
;
padding
:
0
0
0
25px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-webkit-transition
:
background-color
200ms
;
-moz-transition
:
background-color
200ms
;
-o-transition
:
background-color
200ms
;
transition
:
background-color
200ms
;
}
#contacts
li
:hover
{
background-color
:
#eee
}
#contacts
a
{
height
:
23px
;
display
:
block
;
margin
:
0
0
0
0
;
padding
:
0
0
0
25px
;
}
#bottomcontrols
{
padding
:
0
;
bottom
:
0px
;
height
:
2.8em
;
width
:
20em
;
margin
:
0
;
background
:
#eee
;
border-top
:
1px
solid
#ccc
;
position
:
fixed
;
-moz-box-shadow
:
0
-3px
3px
-3px
#000
;
-webkit-box-shadow
:
0
-3px
3px
-3px
#000
;
box-shadow
:
0
-3px
3px
-3px
#000
;}
#contacts_newcontact
{
float
:
left
;
margin
:
0.2em
0
0
1em
;
}
#chooseaddressbook
{
float
:
right
;
margin
:
0.2em
1em
0
0
;
}
...
...
This diff is collapsed.
Click to expand it.
apps/contacts/js/contacts.js
+
17
−
17
View file @
de850dfa
...
...
@@ -160,9 +160,8 @@ Contacts={
// Name has changed. Update it and reorder.
$
(
'
#fn
'
).
change
(
function
(){
var
name
=
$
(
'
#fn
'
).
val
();
var
item
=
$
(
'
#contacts [data-id="
'
+
Contacts
.
UI
.
Card
.
id
+
'
"]
'
).
clone
();
$
(
'
#contacts [data-id="
'
+
Contacts
.
UI
.
Card
.
id
+
'
"]
'
).
remove
();
$
(
item
).
html
(
name
);
var
item
=
$
(
'
#contacts [data-id="
'
+
Contacts
.
UI
.
Card
.
id
+
'
"]
'
);
$
(
item
).
find
(
'
a
'
).
html
(
name
);
var
added
=
false
;
$
(
'
#contacts li
'
).
each
(
function
(){
if
(
$
(
this
).
text
().
toLowerCase
()
>
name
.
toLowerCase
())
{
...
...
@@ -302,7 +301,7 @@ Contacts={
if
(
jsondata
.
status
==
'
success
'
){
Contacts
.
UI
.
Card
.
loadContact
(
jsondata
.
data
);
$
(
'
#leftcontent .active
'
).
removeClass
(
'
active
'
);
var
item
=
$
(
'
<li
role="botton"
data-id="
'
+
jsondata
.
data
.
id
+
'
" class="active" style="background: url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
jsondata
.
data
.
id
+
'
) no-repeat scroll 0% 0% transparent;">
'
+
Contacts
.
UI
.
Card
.
fn
+
'
</li>
'
);
var
item
=
$
(
'
<li data-id="
'
+
jsondata
.
data
.
id
+
'
" class="active"
><a href="index.php?id=
'
+
jsondata
.
data
.
id
+
'
"
style="background: url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
jsondata
.
data
.
id
+
'
) no-repeat scroll 0% 0% transparent;">
'
+
Contacts
.
UI
.
Card
.
fn
+
'
</
a></
li>
'
);
var
added
=
false
;
$
(
'
#leftcontent ul li
'
).
each
(
function
(){
if
(
$
(
this
).
text
().
toLowerCase
()
>
Contacts
.
UI
.
Card
.
fn
.
toLowerCase
())
{
...
...
@@ -625,7 +624,7 @@ Contacts={
q
=
q
+
'
&id=
'
+
this
.
id
+
'
&name=
'
+
name
;
if
(
checksum
!=
undefined
&&
checksum
!=
''
)
{
// save
q
=
q
+
'
&checksum=
'
+
checksum
;
console
.
log
(
'
Saving:
'
+
q
);
//
console.log('Saving: ' + q);
$
(
obj
).
attr
(
'
disabled
'
,
'
disabled
'
);
$
.
post
(
OC
.
filePath
(
'
contacts
'
,
'
ajax
'
,
'
saveproperty.php
'
),
q
,
function
(
jsondata
){
if
(
jsondata
.
status
==
'
success
'
){
...
...
@@ -643,7 +642,7 @@ Contacts={
}
},
'
json
'
);
}
else
{
// add
console
.
log
(
'
Adding:
'
+
q
);
//
console.log('Adding: ' + q);
$
(
obj
).
attr
(
'
disabled
'
,
'
disabled
'
);
$
.
post
(
OC
.
filePath
(
'
contacts
'
,
'
ajax
'
,
'
addproperty.php
'
),
q
,
function
(
jsondata
){
if
(
jsondata
.
status
==
'
success
'
){
...
...
@@ -1498,8 +1497,8 @@ Contacts={
$
(
'
#contacts li
'
).
unbind
(
'
inview
'
);
$
(
'
#contacts li
'
).
bind
(
'
inview
'
,
function
(
event
,
isInView
,
visiblePartX
,
visiblePartY
)
{
if
(
isInView
)
{
if
(
!
$
(
this
).
attr
(
'
style
'
))
{
$
(
this
).
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
$
(
this
).
data
(
'
id
'
)
+
'
) no-repeat
'
);
if
(
!
$
(
this
).
find
(
'
a
'
).
attr
(
'
style
'
))
{
$
(
this
).
find
(
'
a
'
).
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
$
(
this
).
data
(
'
id
'
)
+
'
) no-repeat
'
);
}
}
})},
500
);
...
...
@@ -1508,19 +1507,19 @@ Contacts={
// Add thumbnails to the contact list as they become visible in the viewport.
lazyupdate
:
function
(){
$
(
'
#contacts li
'
).
live
(
'
inview
'
,
function
(){
if
(
!
$
(
this
).
attr
(
'
style
'
))
{
$
(
this
).
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
$
(
this
).
data
(
'
id
'
)
+
'
) no-repeat
'
);
if
(
!
$
(
this
).
find
(
'
a
'
).
attr
(
'
style
'
))
{
$
(
this
).
find
(
'
a
'
).
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
$
(
this
).
data
(
'
id
'
)
+
'
) no-repeat
'
);
}
});
},
refreshThumbnail
:
function
(
id
){
var
item
=
$
(
'
#contacts [data-id="
'
+
id
+
'
"]
'
);
var
item
=
$
(
'
#contacts [data-id="
'
+
id
+
'
"]
'
)
.
find
(
'
a
'
)
;
item
.
html
(
Contacts
.
UI
.
Card
.
fn
);
item
.
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
id
+
'
&refresh=1
'
+
Math
.
random
()
+
'
) no-repeat
'
);
},
scrollTo
:
function
(
id
){
$
(
'
#contacts
'
).
animate
({
scrollTop
:
$
(
'
#leftcontent li[data-id="
'
+
id
+
'
"]
'
).
offset
().
top
},
'
slow
'
,
'
swing
'
);
scrollTop
:
$
(
'
#leftcontent li[data-id="
'
+
id
+
'
"]
'
).
offset
().
top
-
20
},
'
slow
'
,
'
swing
'
);
}
}
}
...
...
@@ -1548,9 +1547,10 @@ $(document).ready(function(){
});
$
(
'
#contacts
'
).
click
(
function
(
event
){
var
$tgt
=
$
(
event
.
target
);
if
(
$tgt
.
is
(
'
li
'
))
{
var
id
=
$
(
$tgt
).
data
(
'
id
'
);
$
(
$tgt
).
addClass
(
'
active
'
);
if
(
$tgt
.
is
(
'
li
'
)
||
$tgt
.
is
(
'
a
'
))
{
var
item
=
$tgt
.
is
(
'
li
'
)?
$
(
$tgt
):(
$tgt
).
parent
();
var
id
=
item
.
data
(
'
id
'
);
item
.
addClass
(
'
active
'
);
var
oldid
=
$
(
'
#rightcontent
'
).
data
(
'
id
'
);
if
(
oldid
!=
0
){
$
(
'
#contacts li[data-id="
'
+
oldid
+
'
"]
'
).
removeClass
(
'
active
'
);
...
...
@@ -1576,9 +1576,9 @@ $(document).ready(function(){
// bottom part of element is visible
}
else
{
// whole part of element is visible
if
(
!
$
(
this
).
attr
(
'
style
'
))
{
if
(
!
$
(
this
).
find
(
'
a
'
).
attr
(
'
style
'
))
{
//alert($(this).data('id') + ' has background: ' + $(this).attr('style'));
$
(
this
).
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
$
(
this
).
data
(
'
id
'
)
+
'
) no-repeat
'
);
$
(
this
).
find
(
'
a
'
).
css
(
'
background
'
,
'
url(
'
+
OC
.
filePath
(
'
contacts
'
,
''
,
'
thumbnail.php
'
)
+
'
?id=
'
+
$
(
this
).
data
(
'
id
'
)
+
'
) no-repeat
'
);
}
/* else {
alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url'));
}*/
...
...
This diff is collapsed.
Click to expand it.
apps/contacts/templates/part.contacts.php
+
1
−
1
View file @
de850dfa
...
...
@@ -8,5 +8,5 @@
}
}
?>
<li
role=
"button"
book-id=
"
<?php
echo
$contact
[
'addressbookid'
];
?>
"
data-id=
"
<?php
echo
$contact
[
'id'
];
?>
"
>
<?php
echo
$display
;
?>
</li>
<li
role=
"button"
book-id=
"
<?php
echo
$contact
[
'addressbookid'
];
?>
"
data-id=
"
<?php
echo
$contact
[
'id'
];
?>
"
><a
href=
"index.php?id=
<?php
echo
$contact
[
'id'
];
?>
"
>
<?php
echo
$display
;
?>
</
a></
li>
<?php
endforeach
;
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment