Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
d45ba9e5
Commit
d45ba9e5
authored
Jun 14, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix some corner cases resulting from narrow window widths.
parent
190142a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
converse.js
converse.js
+13
-10
No files found.
converse.js
View file @
d45ba9e5
...
...
@@ -2549,7 +2549,8 @@
if
(
converse
.
no_trimming
||
(
this
.
model
.
length
<=
1
))
{
return
;
}
var
controlbox_width
=
0
,
var
oldest_chat
,
controlbox_width
=
0
,
$minimized
=
converse
.
minimized_chats
.
$el
,
minimized_width
=
_
.
contains
(
this
.
model
.
pluck
(
'
minimized
'
),
true
)
?
$minimized
.
outerWidth
(
true
)
:
0
,
boxes_width
=
newchat
?
newchat
.
$el
.
outerWidth
(
true
)
:
0
,
...
...
@@ -2570,7 +2571,10 @@
});
if
((
minimized_width
+
boxes_width
+
controlbox_width
)
>
this
.
$el
.
outerWidth
(
true
))
{
this
.
getOldestMaximizedChat
().
minimize
();
oldest_chat
=
this
.
getOldestMaximizedChat
();
if
(
oldest_chat
)
{
oldest_chat
.
minimize
();
}
}
},
...
...
@@ -2578,12 +2582,12 @@
// Get oldest view (which is not controlbox)
var
i
=
0
;
var
model
=
this
.
model
.
sort
().
at
(
i
);
console
.
log
(
this
.
model
.
pluck
(
'
time_opened
'
));
console
.
log
(
this
.
model
.
pluck
(
'
id
'
));
console
.
log
(
this
.
model
.
pluck
(
'
minimized
'
));
while
(
model
.
get
(
'
id
'
)
===
'
controlbox
'
||
model
.
get
(
'
minimized
'
)
===
true
)
{
i
++
;
model
=
this
.
model
.
at
(
i
);
if
(
!
model
)
{
return
null
;
}
}
return
model
;
},
...
...
@@ -2673,9 +2677,8 @@
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
this
.
$el
.
remove
();
this
.
remove
();
this
.
model
.
maximize
();
return
this
;
},
200
)
});
...
...
@@ -2696,8 +2699,7 @@
}
},
this
);
this
.
model
.
on
(
"
destroy
"
,
function
(
item
)
{
this
.
remove
(
item
.
get
(
'
id
'
));
this
.
render
();
this
.
removeChat
(
item
);
},
this
);
this
.
model
.
on
(
"
change:minimized
"
,
function
(
item
)
{
this
.
onChanged
(
item
);
...
...
@@ -2727,7 +2729,8 @@
},
addChat
:
function
(
item
)
{
if
(
this
.
get
(
item
.
get
(
'
id
'
)))
{
var
existing
=
this
.
get
(
item
.
get
(
'
id
'
));
if
(
existing
&&
existing
.
$el
.
parent
().
length
!==
0
)
{
return
;
}
var
view
=
new
converse
.
MinimizedChatBoxView
({
model
:
item
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment