Commit ea1a9ba8 authored by Xiaowu Zhang's avatar Xiaowu Zhang

add remove functionnality in audioplayer

parent 66adf726
......@@ -205,6 +205,15 @@
return;
}
if (options.id === "delete") {
io.removeIO(options.page)
.then(function () {
list.initList(playlist);
// list.display();
});
return;
}
error.noDisplay();
list.noDisplay();
io.noDisplay();
......
......@@ -32,6 +32,18 @@
return "jio getIO error : " + response.target.result;
});
})
.declareMethod('removeIO', function (attachment) {
var gadget = this;
return gadget.jio.removeAttachment({
"_id": gadget.key,
"_attachment": attachment
}).then(function () {
gadget.playlist.splice(gadget.playlist.indexOf(attachment), 1);
gadget.sendPlaylist(gadget.playlist);
}).fail(function (response) {
return "jio removeIO error : " + response.target.result;
});
})
.declareMethod('display', function (attachment) {
input_context.style.display = "";
})
......@@ -87,7 +99,7 @@
for (index = 0; index < input_context.files.length; index += 1) {
found = false;
for (tmp = 0; tmp < g.playlist.length; tmp += 1) {
if (g.playlist[tmp].name === input_context.files[index].name) {
if (g.playlist[tmp] === input_context.files[index].name) {
found = true;
break;
}
......
......@@ -17,7 +17,7 @@
<body>
<div data-role="content">
<ul data-role="listview" data-autodividers="true" data-filter="true" data-split-icon="gear" data-split-theme="d">
<ul data-role="listview" data-autodividers="true" data-filter="true" data-split-icon="delete" data-split-theme="d">
</ul>
</div>
</body>
......
......@@ -26,7 +26,7 @@
+ "</a> "
+ " <a href=#page="
+ array[i]
+ "delete "
+ "&id=delete "
+ "data-rel=popup "
+ "data-position-to=window "
+ "</a>";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment