Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2015-09-01 18:37:40 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
1f03d8fb2acae4bcc087f41347b972bcaf1fc9a3
1f03d8fb
1 parent
69eff86f
Fixed issue with image manager js not being updated
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
resources/assets/js/image-manager.js
resources/assets/js/image-manager.js
View file @
1f03d8f
...
...
@@ -9,7 +9,9 @@ window.ImageManager = new Vue({
hasMore
:
false
,
page
:
0
,
cClickTime
:
0
,
selectedImage
:
false
selectedImage
:
false
,
dependantPages
:
false
,
deleteForm
:
{}
},
created
:
function
()
{
...
...
@@ -63,6 +65,7 @@ window.ImageManager = new Vue({
this
.
hide
();
}
else
{
this
.
selectedImage
=
(
this
.
selectedImage
===
image
)
?
false
:
image
;
this
.
dependantPages
=
false
;
}
this
.
cClickTime
=
cTime
;
},
...
...
@@ -106,15 +109,20 @@ window.ImageManager = new Vue({
deleteImage
:
function
(
e
)
{
e
.
preventDefault
();
var
_this
=
this
;
var
form
=
$
(
_this
.
$$
.
imageDeleteForm
)
;
_this
.
deleteForm
.
force
=
_this
.
dependantPages
!==
false
;
$
.
ajax
(
'/images/'
+
_this
.
selectedImage
.
id
,
{
method
:
'DELETE'
,
data
:
form
.
serialize
()
data
:
_this
.
deleteForm
}).
done
(
function
()
{
_this
.
images
.
splice
(
_this
.
images
.
indexOf
(
_this
.
selectedImage
),
1
);
_this
.
selectedImage
=
false
;
$
(
_this
.
$$
.
imageTitle
).
showSuccess
(
'Image Deleted'
);
})
}).
fail
(
function
(
jqXHR
,
textStatus
)
{
// Pages failure
if
(
jqXHR
.
status
===
400
)
{
_this
.
dependantPages
=
jqXHR
.
responseJSON
;
}
});
}
}
...
...
Please
register
or
sign in
to post a comment