Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9fc6d3d6
Commit
9fc6d3d6
authored
Feb 12, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tagsinput bug related to shallow clone of dashboard
parent
7d9141a0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
21 deletions
+9
-21
src/app/directives/bootstrap-tagsinput.js
+6
-19
src/app/services/dashboard.js
+3
-2
No files found.
src/app/directives/bootstrap-tagsinput.js
View file @
9fc6d3d6
...
...
@@ -53,10 +53,6 @@ function (angular, $) {
scope
.
$parent
[
attrs
.
tagclass
]
:
function
()
{
return
attrs
.
tagclass
;
}
});
for
(
var
i
=
0
;
i
<
scope
.
model
.
length
;
i
++
)
{
select
.
tagsinput
(
'add'
,
scope
.
model
[
i
]);
}
select
.
on
(
'itemAdded'
,
function
(
event
)
{
if
(
scope
.
model
.
indexOf
(
event
.
item
)
===
-
1
)
{
scope
.
model
.
push
(
event
.
item
);
...
...
@@ -74,25 +70,16 @@ function (angular, $) {
// diff when model changes
var
prev
=
scope
.
model
.
slice
();
scope
.
$watch
(
"model"
,
function
()
{
var
added
=
scope
.
model
.
filter
(
function
(
i
)
{
return
prev
.
indexOf
(
i
)
===
-
1
;}),
removed
=
prev
.
filter
(
function
(
i
)
{
return
scope
.
model
.
indexOf
(
i
)
===
-
1
;}),
i
;
prev
=
scope
.
model
.
slice
();
// Remove tags no longer in binded model
for
(
i
=
0
;
i
<
removed
.
length
;
i
++
)
{
select
.
tagsinput
(
'remove'
,
removed
[
i
]);
if
(
!
angular
.
isArray
(
scope
.
model
))
{
scope
.
model
=
[];
}
// Refresh remaining tags
select
.
tagsinput
(
'refresh'
);
select
.
tagsinput
(
'removeAll'
);
// Add new items in model as tags
for
(
i
=
0
;
i
<
added
.
length
;
i
++
)
{
select
.
tagsinput
(
'add'
,
added
[
i
]);
for
(
var
i
=
0
;
i
<
scope
.
model
.
length
;
i
++
)
{
select
.
tagsinput
(
'add'
,
scope
.
model
[
i
]);
}
},
true
);
}
...
...
src/app/services/dashboard.js
View file @
9fc6d3d6
...
...
@@ -120,7 +120,8 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
};
var
dash_defaults
=
function
(
dashboard
)
{
_
.
defaults
(
dashboard
,
_dash
);
_
.
defaults
(
dashboard
,
_dash
);
_
.
defaults
(
dashboard
.
loader
,
_dash
.
loader
);
var
filtering
=
_
.
findWhere
(
dashboard
.
pulldowns
,
{
type
:
'filtering'
});
...
...
@@ -153,7 +154,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
dashboard
=
dash_defaults
(
dashboard
);
// Set the current dashboard
self
.
current
=
_
.
clone
(
dashboard
);
self
.
current
=
angular
.
copy
(
dashboard
);
// Delay this until we're sure that querySrv and filterSrv are ready
$timeout
(
function
()
{
...
...
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