Commit cf8f7659 authored by asseldonk's avatar asseldonk
Browse files

Remove option wheel in table view

parent 7c9ee985
......@@ -9,7 +9,7 @@
<div class="name">Name<i class="glyphicon glyphicon-sort-by-alphabet"></i></div>
<div class="size hidden-sm hidden-xs">Size<i class="glyphicon glyphicon-sort"></i></div>
<div class="time hidden-xs">Modified<i class="glyphicon glyphicon-sort"></i></div>
<div class="options"></div>
<!-- .options-->
</div>
<!-- file list-->
<div class="file-list">
......@@ -25,9 +25,8 @@
</div>
<div class="size hidden-sm hidden-xs"><span data-bind="size"></span><span data-bind="sizeSuffix"></span></div>
<div class="time hidden-xs"><span data-bind="mtime"></span></div>
<div class="file-properties options">
<div class="glyphicon glyphicon-cog"></div>
</div>
<!-- .file-properties.options-->
<!-- .glyphicon.glyphicon-cog-->
</div>
</div>
</div>
\ No newline at end of file
......@@ -10,7 +10,7 @@
i.glyphicon.glyphicon-sort
.time.hidden-xs Modified
i.glyphicon.glyphicon-sort
.options
// .options
// file list
.file-list
.node.file-node(draggable="true", data-bind="data")
......@@ -44,5 +44,5 @@
span(data-bind="sizeSuffix")
.time.hidden-xs
span(data-bind="mtime")
.file-properties.options
.glyphicon.glyphicon-cog
\ No newline at end of file
// .file-properties.options
// .glyphicon.glyphicon-cog
\ No newline at end of file
......@@ -28,7 +28,7 @@ define(["jquery", "jclass"], function($, JClass) {
this.nodeRightClickHold(node, data);
this.nodeClickDblClick(node, data);
this.dragAndDrop(node, data);
this.nodePropertiesClickTab(node);
// this.nodePropertiesClickTab(node);
// this.resizeNodeNameOnHover(node);
if (data.type == "f" && ~this.FileBase.helper.isBrowserFile(data.name)) {
this.nodeSetPreview(data);
......@@ -129,33 +129,33 @@ define(["jquery", "jclass"], function($, JClass) {
}
},
nodePropertiesClickTab: function(node) {
var self = this;
// ####################################################################
node.on("click tap", ".file-properties", function(event) {
event.preventDefault();
if (Object.keys(self.FileBase.selections.entries).length > 1) {
return;
}
var submenu = $("ul", self.FileBase.menuitems.menu);
var posOld = self.FileBase.menuitems.position;
var posNull = self.FileBase.menuitems.nullPosition;
var posNew = self.FileBase.menuitems.getContextMenuPostion(event, submenu);
//if the menu should be opened at the same position close it instead
var cond1 = posOld.x == posNew.x && posOld.y == posNew.y;
//if the menu should be opened again at the null position close it instead
var cond2 = posOld.x == posNull.x && posOld.y == posNull.y;
if (self.FileBase.menuitems.menu.hasClass("open") && (cond1 || cond2)) {
self.FileBase.menuitems.hideMenu();
return;
}
if (!self.FileBase.workflow.selectmode) {
self.FileBase.selections.unselectAll();
}
self.FileBase.selections.changeSelection(node, true);
self.FileBase.menuitems.showMenu(event, null, posNew);
});
},
// nodePropertiesClickTab: function(node) {
// var self = this;
// // ####################################################################
// node.on("click tap", ".file-properties", function(event) {
// event.preventDefault();
// if (Object.keys(self.FileBase.selections.entries).length > 1) {
// return;
// }
// var submenu = $("ul", self.FileBase.menuitems.menu);
// var posOld = self.FileBase.menuitems.position;
// var posNull = self.FileBase.menuitems.nullPosition;
// var posNew = self.FileBase.menuitems.getContextMenuPostion(event, submenu);
// //if the menu should be opened at the same position close it instead
// var cond1 = posOld.x == posNew.x && posOld.y == posNew.y;
// //if the menu should be opened again at the null position close it instead
// var cond2 = posOld.x == posNull.x && posOld.y == posNull.y;
// if (self.FileBase.menuitems.menu.hasClass("open") && (cond1 || cond2)) {
// self.FileBase.menuitems.hideMenu();
// return;
// }
// if (!self.FileBase.workflow.selectmode) {
// self.FileBase.selections.unselectAll();
// }
// self.FileBase.selections.changeSelection(node, true);
// self.FileBase.menuitems.showMenu(event, null, posNew);
// });
// },
setupBkgEvents: function(nodeBkg) {
var self = this;
......
define(["jquery", "jclass"], function($, JClass) {
var TableView = JClass._extend({
init: function(FileBase) {
"use strict";
......@@ -9,7 +9,7 @@ define(["jquery", "jclass"], function($, JClass) {
this.template = null;
this.fileContentContainer = FileBase.view.fileContentContainer;
},
render: function() {
"use strict";
var self = this;
......@@ -23,21 +23,21 @@ define(["jquery", "jclass"], function($, JClass) {
}
});
},
setContent: function(data) {
"use strict";
var self = this;
this.data = data;
// Get the container, empty it and fill the template
this.fileContentContainer.html(this.template);
// setup background drag&drop
self.FileBase.events.dragAndDropBkg(self.fileContentContainer);
// Set the right path
this.FileBase.workflow.parentpath = data.parentpath;
var fileList = $(".file-list", this.fileContentContainer);
// render the content
......@@ -46,13 +46,13 @@ define(["jquery", "jclass"], function($, JClass) {
// set icon size
self.setIconSize();
// resize header of table, also when browser is resized
self.resizeHeader();
$(window).resize(function() {
self.resizeHeader();
});
// make select-all-checkbox clickable
$(".select-all", self.fileContentContainer).click(function(event) {
// not intuitive but works
......@@ -64,29 +64,29 @@ define(["jquery", "jclass"], function($, JClass) {
self.FileBase.selections.unselectAll();
}
});
// call function for sorting carets
var firstRowName = $(".name", ".file-table-head");
firstRowName.click(function() {
self.FileBase.sorting.changeSort("name");
self.toggleSortCarets("name");
});
var firstRowLastChanged = $(".time", ".file-table-head");
firstRowLastChanged.click(function() {
self.FileBase.sorting.changeSort("time");
self.toggleSortCarets("time");
});
var firstRowSize = $(".size", ".file-table-head");
firstRowSize.click(function() {
self.FileBase.sorting.changeSort("size");
self.toggleSortCarets("size");
});
this.toggleSortCarets();
},
toggleSortCarets: function(type, reverse) {
"use strict";
type = type === undefined ? this.FileBase.workflow.sort : type;
......@@ -113,7 +113,7 @@ define(["jquery", "jclass"], function($, JClass) {
}
}
},
setIconSize: function() {
"use strict";
var iconSize = this.FileBase.instance.getPreference("IconSize");
......@@ -132,7 +132,7 @@ define(["jquery", "jclass"], function($, JClass) {
$(".file-table-head", this.fileContentContainer).css("width", sumWidth);
$(".file-table-head .name", this.fileContentContainer).css("width", nameColumnWidth);
},
makeEditButtonsClickable: function(node) {
"use strict";
var self = this;
......@@ -177,7 +177,7 @@ define(["jquery", "jclass"], function($, JClass) {
});
}
},
inlineRename: function(node) {
"use strict";
var self = this;
......@@ -202,7 +202,7 @@ define(["jquery", "jclass"], function($, JClass) {
}
}
replaceWith.css("width", inlineWidth);
// dump filename into rename input field, hide origin and show replace
replaceWith.attr("value", node.data("data").name);
replaceWith.attr("placeholder", node.data("data").name);
......@@ -215,7 +215,7 @@ define(["jquery", "jclass"], function($, JClass) {
replaceWith.click(function(event) {
event.stopPropagation();
});
// rename on blur
replaceWith.blur(function() {
var path = self.FileBase.instance.getState("path");
......@@ -239,8 +239,8 @@ define(["jquery", "jclass"], function($, JClass) {
}
});
}
});
return TableView;
});
\ No newline at end of file
Supports Markdown
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