Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
a3355b08
Commit
a3355b08
authored
Jan 22, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed iconString generator
parent
15403d64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
42 deletions
+33
-42
js/erp5_loader.js
js/erp5_loader.js
+33
-42
No files found.
js/erp5_loader.js
View file @
a3355b08
...
...
@@ -1463,7 +1463,7 @@
* @param {string} portal type
* @param {string} identifier
**/
"
download
"
:
function
()
{
"
download
"
:
function
(
obj
)
{
util
.
error
(
"
Download: Not implemented.
"
);
},
...
...
@@ -2732,6 +2732,30 @@
/* ********************************************************************** */
factory
.
util
=
{};
/**
* Generate a string for icon and iconpos on any JQM element
* util.iconClasses
* @param {object} element Configuration
* @param {string} default_icon Icon to pass as default
* @return {string} finished class snippet
*/
factory
.
util
.
iconClasses
=
function
(
element
,
default_icon
)
{
var
def
,
string
=
""
,
iconpos
=
element
.
attributes
[
"
data-iconpos
"
],
icon
=
element
.
attributes
[
"
data-icon
"
]
||
default_icon
;
if
(
icon
)
{
string
+=
"
ui-icon-
"
+
icon
.
replace
(
"
data-
"
,
""
);
if
(
iconpos
)
{
def
=
iconpos
.
replace
(
"
data-
"
,
""
);
}
string
+=
"
ui-btn-icon-
"
+
(
def
||
"
left
"
);
}
return
string
;
};
/**
* Generate an action menu (controlgroup)
* @actionMenu
...
...
@@ -3373,7 +3397,7 @@
element
.
direct
.
className
=
(
element
.
direct
.
className
||
""
)
+
order
+
(
element
.
type
===
"
a
"
?
(
"
ui-btn ui-shadow
"
+
factory
.
generateIconClassString
(
element
))
:
"
"
);
factory
.
util
.
iconClasses
(
element
))
:
"
"
);
}
// add state
...
...
@@ -3476,11 +3500,6 @@
target
.
appendChild
(
closer
);
}
// class string
if
(
element
.
type
===
"
a
"
)
{
element
.
direct
.
className
+=
"
ui-btn
"
;
}
target
.
appendChild
(
app
.
setContent
(
element
));
panel
.
appendChild
(
target
);
}
...
...
@@ -3560,7 +3579,7 @@
element
.
direct
.
className
=
(
element
.
direct
.
className
||
""
)
+
order
+
(
element
.
type
===
"
a
"
?
(
"
ui-btn ui-shadow
"
+
factory
.
generateIconClassString
(
element
))
:
"
"
);
factory
.
util
.
iconClasses
(
element
))
:
"
"
);
}
}
footer
.
appendChild
(
app
.
setContent
(
element
));
...
...
@@ -3915,7 +3934,7 @@
element
.
direct
.
className
=
(
element
.
direct
.
className
||
""
)
+
order
+
(
element
.
type
===
"
a
"
?
(
"
ui-btn ui-shadow
"
+
factory
.
generateIconClassString
(
element
))
:
"
"
);
factory
.
util
.
iconClasses
(
element
))
:
"
"
);
}
if
(
state
)
{
...
...
@@ -4001,7 +4020,7 @@
element
.
direct
.
className
=
(
element
.
direct
.
className
||
""
)
+
order
+
(
element
.
type
===
"
a
"
?
(
"
ui-btn ui-shadow
"
+
factory
.
generateIconClassString
(
element
))
:
"
"
);
factory
.
util
.
iconClasses
(
element
))
:
"
"
);
}
target
.
appendChild
(
app
.
setContent
(
element
));
...
...
@@ -5035,7 +5054,7 @@
config
.
attributes
[
"
data-cacheval
"
]
=
true
;
break
;
case
"
checkbox
"
:
icon_string
=
factory
.
generateIconClassString
(
config
,
"
checkbox
"
);
icon_string
=
factory
.
util
.
iconClasses
(
config
,
"
checkbox
"
);
container_class_list
=
"
ui-
"
+
config
.
attributes
.
type
;
label_inside
=
true
;
label_class_list
=
"
ui-btn ui-corner-all ui-btn-inherit
"
+
...
...
@@ -5046,7 +5065,7 @@
case
"
submit
"
:
case
"
reset
"
:
if
(
icon
)
{
icon_string
=
factory
.
generateIconClassString
(
config
,
icon
);
icon_string
=
factory
.
util
.
iconClasses
(
config
,
icon
);
}
container_class_list
=
"
ui-btn ui-input-btn
"
+
icon_string
;
need_text_node
=
true
;
...
...
@@ -5089,7 +5108,7 @@
// select
if
(
config
.
type
===
"
select
"
)
{
icon_string
=
factory
.
generateIconClassString
(
config
);
icon_string
=
factory
.
util
.
iconClasses
(
config
);
container_class_list
=
"
ui-
"
+
config
.
type
;
element_target
=
factory
.
element
(
"
div
"
,
...
...
@@ -5346,34 +5365,6 @@
return
element
;
};
/* ********************************************************************** */
/* Class String Generator */
/* ********************************************************************** */
/**
* Generate a string for icon and iconpos on any JQM element
* generateIconClassString
* @param {object} element Configuration
* @param {string} default_icon Icon to pass as default
* @return {string} finished class snippet
*/
factory
.
generateIconClassString
=
function
(
element
,
default_icon
)
{
var
def
,
string
=
""
,
iconpos
=
element
.
attributes
[
"
data-iconpos
"
],
icon
=
element
.
attributes
[
"
data-icon
"
]
||
default_icon
;
if
(
icon
)
{
string
+=
"
ui-icon-
"
+
icon
.
replace
(
"
data-
"
,
""
);
if
(
iconpos
)
{
def
=
iconpos
.
replace
(
"
data-
"
,
""
);
}
string
+=
"
ui-btn-icon-
"
+
(
def
||
"
left
"
);
}
return
string
;
};
/* ====================================================================== */
/* STORAGE */
/* ====================================================================== */
...
...
@@ -7543,7 +7534,7 @@
convert
=
"
values
"
;
}
console
.
log
(
parcel
.
query
)
return
storage
[
parcel
.
storage
][
method
||
"
allDocs
"
](
parcel
.
query
,
hacked_view
)
.
then
(
function
(
response
)
{
// TODO: best way?
...
...
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