]> source.dussan.org Git - nextcloud-server.git/commitdiff
filepicker styling 1756/head
authorRobin Appelman <robin@icewind.nl>
Fri, 14 Oct 2016 15:31:10 +0000 (17:31 +0200)
committerRobin Appelman <robin@icewind.nl>
Fri, 14 Oct 2016 15:36:08 +0000 (17:36 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
core/css/jquery.ocdialog.css
core/css/styles.css
core/js/oc-dialogs.js
core/templates/filepicker.html

index b241dcfea6f2e1eca9ca4d7bf3633445a71f9246..a19fa4c52b582ce0aca43d5cf5213bd3cf90ea4b 100644 (file)
@@ -14,7 +14,8 @@
        background: white;
        font-weight: bold;
        font-size: 110%;
-       margin-bottom: 10px;
+       margin-bottom: 5px;
+       margin-top: -9px;
 }
 .oc-dialog-content {
        z-index: 1000;
index 60b325111f8cd5980e6db0037b457376e31368cd..958a93a600ceed60e27a0a2b00f473aeb946efe4 100644 (file)
@@ -774,29 +774,39 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin
 .ui-datepicker-prev,.ui-datepicker-next{ border:1px solid #ddd; background:#fff; }
 
 /* ---- DIALOGS ---- */
-#oc-dialog-filepicker-content .dirtree {width:92%; overflow:hidden; }
-#oc-dialog-filepicker-content .dirtree .home {
+#oc-dialog-filepicker-content .dirtree {
+       width:92%;
+       float: left;
+       margin-left: 15px;
+       overflow:hidden;
+}
+#oc-dialog-filepicker-content .dirtree div:first-child a {
        background-image:url('../img/places/home.svg?v=1');
        background-repeat:no-repeat;
        background-position: left center;
-       width: 30px;
-       display: inline-block;
 }
 #oc-dialog-filepicker-content .dirtree span:not(:last-child) { cursor: pointer; }
 #oc-dialog-filepicker-content .dirtree span:last-child { font-weight: bold; }
 #oc-dialog-filepicker-content .dirtree span:not(:last-child)::after { content: '>'; padding: 3px;}
 #oc-dialog-filepicker-content .filelist {
        overflow-y:auto;
-       height: 300px;
+       height: 290px;
        background-color:white;
        width:100%;
 }
+
+#oc-dialog-filepicker-content .filelist li:first-child {
+       border-top: 1px solid #eee;
+}
 #oc-dialog-filepicker-content .filelist li {
        position: relative;
+       height: 40px;
+       padding: 5px;
+       border-bottom: 1px solid #eee;
 }
 #oc-dialog-filepicker-content .filelist .filename {
        position: absolute;
-       top: 8px;
+       padding-top: 9px;
        max-width: 60%;
        overflow: hidden;
        white-space: nowrap;
index edc0b3c797a351b2451ecfea2dc08a15e7f719a5..87d16a1394a92b0f6f35580624442501b4fb6a05 100644 (file)
@@ -174,7 +174,7 @@ var OCdialogs = {
                        self.$filePicker.ready(function() {
                                self.$filelist = self.$filePicker.find('.filelist');
                                self.$dirTree = self.$filePicker.find('.dirtree');
-                               self.$dirTree.on('click', 'span:not(:last-child)', self, self._handleTreeListSelect);
+                               self.$dirTree.on('click', 'div:not(:last-child)', self, self._handleTreeListSelect.bind(self));
                                self.$filelist.on('click', 'li', function(event) {
                                        self._handlePickerClick(event, $(this));
                                });
@@ -799,8 +799,9 @@ var OCdialogs = {
        _fillSlug: function() {
                this.$dirTree.empty();
                var self = this;
+               var dir;
                var path = this.$filePicker.data('path');
-               var $template = $('<span data-dir="{dir}">{name}</span>');
+               var $template = $('<div data-dir="{dir}"><a>{name}</a></div>').addClass('crumb');
                if(path) {
                        var paths = path.split('/');
                        $.each(paths, function(index, dir) {
@@ -816,17 +817,17 @@ var OCdialogs = {
                }
                $template.octemplate({
                        dir: '',
-                       name: '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' // Ugly but works ;)
-               }, {escapeFunction: null}).addClass('home svg').prependTo(this.$dirTree);
+                       name: '' // Ugly but works ;)
+               }, {escapeFunction: null}).prependTo(this.$dirTree);
        },
        /**
         * handle selection made in the tree list
        */
        _handleTreeListSelect:function(event) {
                var self = event.data;
-               var dir = $(event.target).data('dir');
+               var dir = $(event.target).parent().data('dir');
                self._fillFilePicker(dir);
-               var getOcDialog = this.closest('.oc-dialog');
+               var getOcDialog = (event.target).closest('.oc-dialog');
                var buttonEnableDisable = $('.primary', getOcDialog);
                if (this.$filePicker.data('mimetype') === "http/unix-directory") {
                        buttonEnableDisable.prop("disabled", false);
index e761fbdb567bb89623465c146a2bb786835f3eb0..46d1ca3d52dd53463da2b425cef7cef84d411d0e 100644 (file)
@@ -1,5 +1,5 @@
 <div id="{dialog_name}" title="{title}">
-       <span class="dirtree"></span>
+       <span class="dirtree breadcrumb"></span>
        <ul class="filelist">
                <li data-entryname="{filename}" data-type="{type}">
                        <img />