},
/**
+ * Remove specified path is already in clipboard
+ * @param {string} path full path
+ * @returns {number} current length of clipboard objects
+ */
+ remove: function Clipboard_remove(path) {
+ var index = $.inArray(path, this.data);
+ var length;
+ if (index >= 0) {
+ this.data.splice(index, 1);
+ length = this.data.length;
+ if (length === 0) {
+ this.mode = this.INACTIVE_MODE;
+ }
+ }
+ return length;
+ },
+
+ /**
* Checks if specified path is already in clipboard
* @param {string} path full path
* @returns {boolean}
*/
refreshCurrentPage: function App_refreshCurrentPage(refresh) {
refresh = refresh || false;
+ if (this.currentPath === 'root') {
+ return;
+ }
if (this.currentPath !== '') {
app.model.isStorageExists(this.currentPath,
app.displayFolder.bind(app, app.model.currentPath, refresh),
self = this,
onDeleteNodeSuccess = function (node, isDir, fileobject) {
try {
+ if (app.clipboard.remove(node.uri) === 0) {
+ app.ui.refreshPasteActionBtn();
+ }
this.refreshContent(fileobject.toURI());
} catch (e) {
console.error(e);
}
},
onCopyNodeFailure = function () {
- app.ui.alertPopup('Copying error');
+ setTimeout(function () {
+ app.ui.alertPopup('Copying error');
+ }, 200);
},
i,
sourceName,
this.systemIO.getFilesList(dir, function (filesList) {
for (i = 0; i < len; i = i + 1) {
if (destinationPath.indexOf(paths[i]) !== -1) {
- app.ui.alertPopup('Copying error');
+ setTimeout(function () {
+ app.ui.alertPopup('Copying error');
+ }, 200);
return;
}
}
window.addEventListener('tizenhwkey', function(e) {
var uri = $('#navbar span+span').attr('uri');
if (e.keyName == "back") {
- if (!uri) {
+ if ($.mobile.popup.active) {
+ $.mobile.popup.active.close();
+ } else if (self.editMode === true) {
+ self.handleCancelEditAction();
+ } else if (!uri) {
if ( app.ui.root === false ) {
$('#fileList').empty();
app.ui.prepareFolderRow(0, "root");
} else {
tizen.application.getCurrentApplication().exit();
}
- } else if ($.mobile.popup.active !== undefined) {
- $(".ui-popup").popup('close');
} else {
app.goLevelUp();
}
-
- if (self.editMode === true) {
- self.handleCancelEditAction();
- }
}
});
alertPopup: function (text, callback) {
$("#alertPopup .text").text(text);
- $("#alertPopup").popup('open', {'positionTo': 'window'})
+ $("#alertPopup").popup('open', {'positionTo': 'window'});
if (callback instanceof Function) {
$("#alertPopup").one("popupafterclose", function () {
callback();