Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
af7aab3a
Commit
af7aab3a
authored
Dec 14, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(bootgrid) return to current page after action, for
https://github.com/opnsense/core/issues/1303
parent
feb11e59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
opnsense_bootgrid_plugin.js
src/opnsense/www/js/opnsense_bootgrid_plugin.js
+17
-4
No files found.
src/opnsense/www/js/opnsense_bootgrid_plugin.js
View file @
af7aab3a
...
@@ -80,6 +80,19 @@ function stdBootgridUI(obj, sourceUrl, options) {
...
@@ -80,6 +80,19 @@ function stdBootgridUI(obj, sourceUrl, options) {
return
grid
;
return
grid
;
}
}
/**
* reload bootgrid, return to current selected page
*/
function
std_bootgrid_reload
(
gridId
)
{
var
currentpage
=
$
(
"
#
"
+
gridId
).
bootgrid
(
"
getCurrentPage
"
);
$
(
"
#
"
+
gridId
).
bootgrid
(
"
reload
"
);
// absolutely not perfect, bootgrid.reload doesn't seem to support when().done()
setTimeout
(
function
(){
$
(
'
#
'
+
gridId
+
'
-footer a[data-page="
'
+
currentpage
+
'
"]
'
).
click
();
},
400
);
}
/**
/**
* creates new bootgrid object and links actions to our standard templates
* creates new bootgrid object and links actions to our standard templates
* uses the following data properties to define functionality:
* uses the following data properties to define functionality:
...
@@ -135,7 +148,7 @@ $.fn.UIBootgrid = function (params) {
...
@@ -135,7 +148,7 @@ $.fn.UIBootgrid = function (params) {
saveFormToEndpoint
(
url
=
gridParams
[
'
set
'
]
+
uuid
,
saveFormToEndpoint
(
url
=
gridParams
[
'
set
'
]
+
uuid
,
formid
=
'
frm_
'
+
editDlg
,
callback_ok
=
function
(){
formid
=
'
frm_
'
+
editDlg
,
callback_ok
=
function
(){
$
(
"
#
"
+
editDlg
).
modal
(
'
hide
'
);
$
(
"
#
"
+
editDlg
).
modal
(
'
hide
'
);
$
(
"
#
"
+
gridId
).
bootgrid
(
"
reload
"
);
std_bootgrid_reload
(
gridId
);
},
true
);
},
true
);
}
else
{
}
else
{
console
.
log
(
"
[grid] action set missing
"
)
console
.
log
(
"
[grid] action set missing
"
)
...
@@ -169,7 +182,7 @@ $.fn.UIBootgrid = function (params) {
...
@@ -169,7 +182,7 @@ $.fn.UIBootgrid = function (params) {
saveFormToEndpoint
(
url
=
gridParams
[
'
add
'
],
saveFormToEndpoint
(
url
=
gridParams
[
'
add
'
],
formid
=
'
frm_
'
+
editDlg
,
callback_ok
=
function
(){
formid
=
'
frm_
'
+
editDlg
,
callback_ok
=
function
(){
$
(
"
#
"
+
editDlg
).
modal
(
'
hide
'
);
$
(
"
#
"
+
editDlg
).
modal
(
'
hide
'
);
$
(
"
#
"
+
gridId
).
bootgrid
(
"
reload
"
);
std_bootgrid_reload
(
gridId
);
},
true
);
},
true
);
}
else
{
}
else
{
console
.
log
(
"
[grid] action add missing
"
)
console
.
log
(
"
[grid] action add missing
"
)
...
@@ -207,7 +220,7 @@ $.fn.UIBootgrid = function (params) {
...
@@ -207,7 +220,7 @@ $.fn.UIBootgrid = function (params) {
ajaxCall
(
url
=
gridParams
[
'
toggle
'
]
+
uuid
,
ajaxCall
(
url
=
gridParams
[
'
toggle
'
]
+
uuid
,
sendData
=
{},
callback
=
function
(
data
,
status
){
sendData
=
{},
callback
=
function
(
data
,
status
){
// reload grid after delete
// reload grid after delete
$
(
"
#
"
+
gridId
).
bootgrid
(
"
reload
"
);
std_bootgrid_reload
(
gridId
);
});
});
}
else
{
}
else
{
console
.
log
(
"
[grid] action toggle missing
"
)
console
.
log
(
"
[grid] action toggle missing
"
)
...
@@ -255,7 +268,7 @@ $.fn.UIBootgrid = function (params) {
...
@@ -255,7 +268,7 @@ $.fn.UIBootgrid = function (params) {
});
});
// refresh after load
// refresh after load
$
.
when
.
apply
(
null
,
deferreds
).
done
(
function
(){
$
.
when
.
apply
(
null
,
deferreds
).
done
(
function
(){
$
(
"
#
"
+
gridId
).
bootgrid
(
"
reload
"
);
std_bootgrid_reload
(
gridId
);
});
});
}
}
});
});
...
...
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