Commit dc5a802e authored by Nick Poulden's avatar Nick Poulden
Browse files

Drag drop favs styling

parent fc239e14
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,12 +83,12 @@ Ext.define('Docs.controller.Classes', {
        this.control({
            'classtree': {
                classclick: function(cls, event) {
                    (event.button === this.MIDDLE) ? window.open("#/api/" + cls) : this.loadClass(cls);
                    (event.button === this.MIDDLE || event.shiftKey || event.ctrlKey) ? window.open("#/api/" + cls) : this.loadClass(cls);
                }
            },
            'classgrid': {
                classclick: function(cls, event) {
                    (event.button === this.MIDDLE) ? window.open("#/api/" + cls) : this.loadClass(cls);
                    (event.button === this.MIDDLE || event.shiftKey || event.ctrlKey) ? window.open("#/api/" + cls) : this.loadClass(cls);
                }
            },

+16 −3
Original line number Diff line number Diff line
@@ -103,15 +103,28 @@ Ext.define('Docs.view.Viewport', {
                                        title: 'Favorites',
                                        iconCls: 'icon-fav',
                                        viewConfig: {
                                            plugins: {
                                                ptype: 'gridviewdragdrop'
                                            }
                                            plugins: [{
                                                pluginId: 'favGridDD',
                                                ptype: 'gridviewdragdrop',
                                                dragText: 'Drag and drop to reorganize'
                                            }]
                                        },
                                        store: Ext.getStore('Favorites'),
                                        icons: Docs.icons,
                                        listeners: {
                                            closeclick: function(cls) {
                                                Docs.Favorites.remove(cls);
                                            },
                                            afterrender: function() {
                                                var ddPlugin = this.getView().getPlugin('favGridDD');

                                                ddPlugin.dragZone.onInitDrag = function() {
                                                    Ext.getCmp('favorites-grid').addCls('drag');
                                                    Ext.view.DragZone.prototype.onInitDrag.apply(this, arguments);
                                                }
                                                ddPlugin.dragZone.afterValidDrop = ddPlugin.dragZone.afterInvalidDrop = function() {
                                                    Ext.getCmp('favorites-grid').removeCls('drag');
                                                }
                                            }
                                        }
                                    }
+5 −0
Original line number Diff line number Diff line
@@ -221,6 +221,11 @@ a {
      background-color: #f0f0f0; }
    .x-grid-row-over td img {
      display: block; }
    .drag {
      .x-grid-row-over td {
        background: none; }
      .x-grid-row-over td img {
        display: none; } }
    .x-grid-cell-inner {
      padding: 2px 2px 3px 2px; } }
  .x-splitter {