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
dariah
search-commons-webresources
Commits
f6e0349b
Commit
f6e0349b
authored
May 04, 2019
by
Gradl, Tobias
Browse files
1289: Finalize initial version of item view
Task-Url:
https://pm.winseda.de/issues/1289
parent
64d20b26
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/item/item.js
View file @
f6e0349b
...
...
@@ -17,12 +17,13 @@ var ResultItem = function(options) {
this
.
modelId
=
$
(
"
#modelId
"
).
val
();
this
.
itemId
=
$
(
"
#itemId
"
).
val
();
this
.
loadedData
=
[];
$
(
'
.venobox
'
).
venobox
();
};
ResultItem
.
prototype
.
resize
=
function
()
{
var
innerWidth
=
$
(
"
#item-images
-container
"
).
width
();
var
innerWidth
=
$
(
"
#item-images
"
).
width
();
if
(
innerWidth
>
this
.
options
.
images
.
maxWidth
)
{
innerWidth
=
this
.
options
.
images
.
maxWidth
;
}
...
...
@@ -36,6 +37,8 @@ ResultItem.prototype.resize = function() {
$
(
"
#carousel-item-images
"
).
css
(
"
width
"
,
innerWidth
+
"
px
"
);
$
(
"
.item-image
"
).
css
(
"
height
"
,
innerWidth
+
"
px
"
);
$
(
"
.item-image
"
).
css
(
"
width
"
,
innerWidth
+
"
px
"
);
$
(
"
.collection-image span
"
).
css
(
"
font-size
"
,
Math
.
floor
(
$
(
"
.collection-image
"
).
width
()
*
0.07
));
};
ResultItem
.
prototype
.
loadOriginalData
=
function
(
button
)
{
...
...
@@ -46,18 +49,30 @@ ResultItem.prototype.loadIntegratedData = function(button) {
this
.
loadData
(
"
integrations
"
,
"
#item-detail-integrated-container
"
,
"
#item-detail-integrated
"
,
button
);
};
ResultItem
.
prototype
.
loadData
=
function
(
dataType
,
containerSelector
,
contentSelector
,
button
)
{
$
.
ajax
({
url
:
__util
.
getBaseUrl
()
+
"
item/
"
+
this
.
modelId
+
"
/
"
+
this
.
itemId
+
"
/data?type=
"
+
dataType
,
type
:
"
GET
"
,
dataType
:
"
html
"
,
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
$
(
button
).
hide
();
$
(
containerSelector
).
addClass
(
"
show
"
);
$
(
contentSelector
).
html
(
data
);
},
error
:
__util
.
processServerError
});
ResultItem
.
prototype
.
loadData
=
function
(
dataType
,
containerSelector
,
contentSelector
,
button
)
{
var
indicator
=
$
(
button
).
find
(
"
.fas
"
);
if
(
$
(
containerSelector
).
hasClass
(
"
show
"
))
{
$
(
containerSelector
).
removeClass
(
"
show
"
);
$
(
indicator
).
addClass
(
"
fa-chevron-circle-down
"
).
removeClass
(
"
fa-chevron-circle-up
"
);
}
else
if
(
this
.
loadedData
.
includes
(
dataType
))
{
$
(
containerSelector
).
addClass
(
"
show
"
);
$
(
indicator
).
addClass
(
"
fa-chevron-circle-up
"
).
removeClass
(
"
fa-chevron-circle-down
"
);
}
else
{
var
_this
=
this
;
$
(
indicator
).
addClass
(
"
fa-spinner fa-spin
"
).
removeClass
(
"
fa-chevron-circle-down
"
);
$
.
ajax
({
url
:
__util
.
getBaseUrl
()
+
"
item/
"
+
this
.
modelId
+
"
/
"
+
this
.
itemId
+
"
/data?type=
"
+
dataType
,
type
:
"
GET
"
,
dataType
:
"
html
"
,
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
$
(
containerSelector
).
addClass
(
"
show
"
);
$
(
contentSelector
).
html
(
data
);
_this
.
loadedData
.
push
(
dataType
);
$
(
indicator
).
addClass
(
"
fa-chevron-circle-up
"
).
removeClass
(
"
fa-spinner fa-spin
"
);
},
error
:
__util
.
processServerError
});
}
};
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