Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
98f263cf
Commit
98f263cf
authored
Jan 02, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Move delete button on the listbox itself
parent
fd1b1532
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
12 deletions
+69
-12
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+32
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_html.html
...em/web_page_module/rjs_gadget_erp5_pt_form_list_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_html.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_list_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
+30
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
98f263cf
...
...
@@ -337,6 +337,8 @@
"
getListboxClipboardActionList
"
)
.
declareAcquiredMethod
(
"
triggerListboxSelectAction
"
,
"
triggerListboxSelectAction
"
)
.
declareAcquiredMethod
(
"
triggerListboxClipboardAction
"
,
"
triggerListboxClipboardAction
"
)
//////////////////////////////////////////////
// initialize the gadget content
...
...
@@ -685,7 +687,7 @@
h1_element
.
appendChild
(
span_element
);
div_element
.
appendChild
(
h1_element
);
if
(
gadget
.
state
.
show_
line_selector
)
{
if
(
gadget
.
state
.
show_
select_action
)
{
for
(
k
=
0
;
k
<
select_option_list
.
length
;
k
+=
1
)
{
// Add include button
// <button data-rel="hide" data-i18n="Include" name="IncludeRows" type="button" class="ui-icon-eye ui-btn-icon-left {{hide_class}}"></button>
...
...
@@ -709,6 +711,30 @@
button_element
.
textContent
=
translation_list
[
4
];
div_element
.
appendChild
(
button_element
);
}
else
if
(
gadget
.
state
.
show_clipboard_action
)
{
for
(
k
=
0
;
k
<
select_option_list
.
length
;
k
+=
1
)
{
// Add include button
// <button data-rel="hide" data-i18n="Include" name="IncludeRows" type="button" class="ui-icon-eye ui-btn-icon-left {{hide_class}}"></button>
button_element
=
document
.
createElement
(
'
button
'
);
button_element
.
setAttribute
(
'
data-rel
'
,
'
clipboard
'
);
button_element
.
setAttribute
(
'
data-clipboard-action
'
,
select_option_list
[
k
].
action
);
button_element
.
setAttribute
(
'
name
'
,
'
ClipboardAction
'
);
button_element
.
type
=
'
button
'
;
button_element
.
setAttribute
(
'
class
'
,
'
ui-icon-
'
+
select_option_list
[
k
].
icon
+
'
ui-btn-icon-left
'
+
gadget
.
state
.
hide_class
);
button_element
.
textContent
=
select_option_list
[
k
].
title
;
div_element
.
appendChild
(
button_element
);
}
// Add cancel button
// <button data-rel="cancel" data-i18n="Cancel" name="ExcludeRows" type="button" class="ui-icon-times ui-btn-icon-left {{hide_class}}"></button>
button_element
=
document
.
createElement
(
'
button
'
);
button_element
.
setAttribute
(
'
data-rel
'
,
'
hide
'
);
button_element
.
setAttribute
(
'
name
'
,
'
CancelSelect
'
);
button_element
.
type
=
'
button
'
;
button_element
.
setAttribute
(
'
class
'
,
'
ui-icon-times ui-btn-icon-left
'
+
gadget
.
state
.
hide_class
);
button_element
.
textContent
=
translation_list
[
4
];
div_element
.
appendChild
(
button_element
);
}
else
{
// Add Configure button
...
...
@@ -1306,7 +1332,7 @@
}
if
((
evt
.
target
.
type
===
'
button
'
)
&&
(
evt
.
target
.
name
===
'
SelectAction
'
))
{
(
(
evt
.
target
.
name
===
'
SelectAction
'
)
||
(
evt
.
target
.
name
===
'
ClipboardAction
'
)
))
{
evt
.
preventDefault
();
checked_uid_list
=
[];
...
...
@@ -1322,7 +1348,10 @@
unchecked_uid_list
.
push
(
all_hide_element_list
[
i
].
getAttribute
(
"
data-uid
"
));
}
}
return
gadget
.
triggerListboxSelectAction
(
evt
.
target
.
getAttribute
(
'
data-select-action
'
),
checked_uid_list
,
unchecked_uid_list
);
if
(
evt
.
target
.
name
===
'
SelectAction
'
)
{
return
gadget
.
triggerListboxSelectAction
(
evt
.
target
.
getAttribute
(
'
data-select-action
'
),
checked_uid_list
,
unchecked_uid_list
);
}
return
gadget
.
triggerListboxClipboardAction
(
evt
.
target
.
getAttribute
(
'
data-clipboard-action
'
),
checked_uid_list
,
unchecked_uid_list
);
}
},
false
,
false
)
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
98f263cf
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
972.469
54.57423.23859
</string>
</value>
<value>
<string>
972.469
80.18805.19558
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
154642
2454.02
</float>
<float>
154642
3960.78
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_html.html
View file @
98f263cf
...
...
@@ -4,6 +4,7 @@
<!--
data-i18n=Include
data-i18n=Exclude
data-i18n=Delete
-->
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width"
/>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_html.xml
View file @
98f263cf
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
972.2
5327.46098.50073
</string>
</value>
<value>
<string>
972.2
9743.559.65006
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
154
5389700.46
</float>
<float>
154
6423008.44
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
View file @
98f263cf
/*global window, rJS, RSVP, calculatePageTitle, SimpleQuery, ComplexQuery,
Query, QueryFactory */
Query, QueryFactory
, ensureArray
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
SimpleQuery
,
ComplexQuery
,
Query
,
QueryFactory
)
{
Query
,
QueryFactory
,
ensureArray
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -281,7 +281,34 @@
}
throw
new
Error
(
'
Unsupported triggerListboxSelectAction action:
'
+
action
);
})
// Handle listbox custom button
.
allowPublicAcquisition
(
"
getListboxClipboardActionList
"
,
function
getListboxClipboardActionList
()
{
var
delete_list
=
ensureArray
(
this
.
state
.
erp5_document
.
_links
.
action_object_delete_action
);
if
(
!
delete_list
.
length
)
{
return
[];
}
return
this
.
getTranslationList
([
'
Delete
'
])
.
push
(
function
(
result_list
)
{
return
[{
title
:
result_list
[
0
],
icon
:
'
trash-o
'
,
action
:
'
delete
'
}];
});
})
.
allowPublicAcquisition
(
"
triggerListboxClipboardAction
"
,
function
triggerListboxClipboardAction
(
argument_list
)
{
var
delete_list
=
ensureArray
(
this
.
state
.
erp5_document
.
_links
.
action_object_delete_action
);
return
this
.
redirect
({
command
:
'
change
'
,
options
:
{
"
view
"
:
delete_list
[
0
].
href
,
"
page
"
:
undefined
}
});
});
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
SimpleQuery
,
ComplexQuery
,
Query
,
QueryFactory
));
\ No newline at end of file
QueryFactory
,
ensureArray
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
98f263cf
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
972.
27145.17258.43178
</string>
</value>
<value>
<string>
972.
47042.3653.24524
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
154
5233919.1
</float>
<float>
154
6427695.43
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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