Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
8bde1e82
Commit
8bde1e82
authored
Nov 05, 2013
by
Kostas Papadimitriou
Browse files
ui: Base view object fixes
parent
405c82a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/ui/static/snf/js/views.js
View file @
8bde1e82
...
...
@@ -67,7 +67,7 @@
post_hide
:
function
()
{},
initialize
:
function
(
options
)
{
views
.
View
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
views
.
View
.
__super__
.
initialize
.
apply
(
this
,
[
options
]
);
this
.
log
=
new
snf
.
logging
.
logger
(
"
SNF-VIEWS:
"
+
this
.
view_id
);
this
.
parent_view
=
options
&&
options
.
parent_view
;
},
...
...
snf-cyclades-app/synnefo/ui/static/snf/js/views_ext.js
View file @
8bde1e82
...
...
@@ -35,6 +35,7 @@
post_init
:
function
()
{},
initialize
:
function
(
options
)
{
views
.
ext
.
View
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
this
.
container
=
options
&&
options
.
container
;
this
.
_subviews
=
[];
if
(
this
.
tpl
)
{
...
...
@@ -124,6 +125,7 @@
rivets_unbind
:
function
()
{
if
(
!
this
.
rivets_view
)
{
return
}
if
(
!
this
.
rivets
)
{
return
}
this
.
rivets
.
unbind
();
},
...
...
@@ -345,8 +347,10 @@
// make it visible by default
this
.
add_subview
(
view
);
view
.
show
(
true
);
this
.
post_add_model_view
(
view
,
model
);
},
post_add_model_view
:
function
()
{},
each_model_view
:
function
(
cb
,
context
)
{
if
(
!
context
)
{
context
=
this
};
_
.
each
(
this
.
_model_views
,
function
(
view
,
model_id
){
...
...
@@ -356,7 +360,6 @@
},
remove_model
:
function
(
m
)
{
console
.
log
(
"
REMOVING MODEL
"
,
m
);
var
model_view
=
this
.
_model_views
[
m
.
id
];
if
(
!
model_view
)
{
console
.
error
(
"
no view found
"
);
...
...
@@ -365,10 +368,13 @@
model_view
.
hide
();
model_view
.
el
.
remove
();
this
.
remove_view
(
model_view
);
this
.
post_remove_model_view
(
model_view
,
model
);
delete
this
.
_model_views
[
m
.
id
];
this
.
check_empty
();
},
post_remove_model_view
:
function
()
{},
update_models
:
function
(
m
)
{
this
.
check_empty
();
this
.
collection
.
each
(
function
(
model
,
index
)
{
...
...
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