Commit e312676cffede4d00afd3082ad9c00f8fa248b78
1 parent
adc58f09
KTS-1722
"Can't drag dashlets onto right-hand side of dashboard. " Fixed. Reviewed By: Conrad git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6338 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
14 additions
and
4 deletions
resources/js/DDList.js
| 1 | YAHOO.example.DDList = function(id, sGroup, config) { | 1 | YAHOO.example.DDList = function(id, sGroup, config) { |
| 2 | - | ||
| 3 | if (id) { | 2 | if (id) { |
| 4 | this.init(id, sGroup, config); | 3 | this.init(id, sGroup, config); |
| 5 | this.initFrame(); | 4 | this.initFrame(); |
| @@ -56,6 +55,9 @@ YAHOO.example.DDList.prototype.onDragOver = function(e, id) { | @@ -56,6 +55,9 @@ YAHOO.example.DDList.prototype.onDragOver = function(e, id) { | ||
| 56 | if(p.id != 'dashboard-container-left' && p.id != 'dashboard-container-right') { | 55 | if(p.id != 'dashboard-container-left' && p.id != 'dashboard-container-right') { |
| 57 | return; | 56 | return; |
| 58 | } | 57 | } |
| 58 | + if(el2.id === 'end-left' || el2.id === 'end-right'){ | ||
| 59 | + return; | ||
| 60 | + } | ||
| 59 | p.insertBefore(el2, el); | 61 | p.insertBefore(el2, el); |
| 60 | } | 62 | } |
| 61 | 63 |
resources/js/dashboard.js
| @@ -101,6 +101,12 @@ KTDashboard.prototype = { | @@ -101,6 +101,12 @@ KTDashboard.prototype = { | ||
| 101 | //new YAHOO.util.DD(e.id); | 101 | //new YAHOO.util.DD(e.id); |
| 102 | } | 102 | } |
| 103 | }, this.getDashletBlocks()); | 103 | }, this.getDashletBlocks()); |
| 104 | + map(function(e) { | ||
| 105 | + if(e.id) { | ||
| 106 | + new YAHOO.example.DDList(e.id); | ||
| 107 | + //new YAHOO.util.DD(e.id); | ||
| 108 | + } | ||
| 109 | + }, this.getDashletBlockStoppers()); | ||
| 104 | new YAHOO.example.DDListBoundary('copyrightbar'); | 110 | new YAHOO.example.DDListBoundary('copyrightbar'); |
| 105 | new YAHOO.example.DDListBoundary('breadcrumbs'); | 111 | new YAHOO.example.DDListBoundary('breadcrumbs'); |
| 106 | new YAHOO.example.DDListBoundary('bodyLeftRepeat'); | 112 | new YAHOO.example.DDListBoundary('bodyLeftRepeat'); |
| @@ -111,6 +117,10 @@ KTDashboard.prototype = { | @@ -111,6 +117,10 @@ KTDashboard.prototype = { | ||
| 111 | 'getDashletBlocks' : function() { | 117 | 'getDashletBlocks' : function() { |
| 112 | return getElementsByTagAndClassName('*', 'dashboard_block', this.element); | 118 | return getElementsByTagAndClassName('*', 'dashboard_block', this.element); |
| 113 | }, | 119 | }, |
| 120 | + | ||
| 121 | + 'getDashletBlockStoppers' : function(){ | ||
| 122 | + return getElementsByTagAndClassName('*', 'dashboard_block_empty', this.element); | ||
| 123 | + }, | ||
| 114 | 124 | ||
| 115 | 'hideAddButton' : function() { | 125 | 'hideAddButton' : function() { |
| 116 | hideElement(this.addButton); | 126 | hideElement(this.addButton); |
| @@ -298,4 +308,4 @@ addLoadEvent( | @@ -298,4 +308,4 @@ addLoadEvent( | ||
| 298 | } | 308 | } |
| 299 | }); | 309 | }); |
| 300 | 310 | ||
| 301 | - | ||
| 302 | \ No newline at end of file | 311 | \ No newline at end of file |
| 312 | + |
templates/kt3/dashboard.smarty
| 1 | <div id="dashboard-container-left"> | 1 | <div id="dashboard-container-left"> |
| 2 | - <div class="dashboard_block_empty" id="start-left"> </div> | ||
| 3 | {foreach item=oDashlet from=$dashlets_left} | 2 | {foreach item=oDashlet from=$dashlets_left} |
| 4 | <div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}"> | 3 | <div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}"> |
| 5 | <div class="{$oDashlet->sClass}"> | 4 | <div class="{$oDashlet->sClass}"> |
| @@ -36,7 +35,6 @@ | @@ -36,7 +35,6 @@ | ||
| 36 | </div> | 35 | </div> |
| 37 | 36 | ||
| 38 | <div id="dashboard-container-right"> | 37 | <div id="dashboard-container-right"> |
| 39 | - <div class="dashboard_block_empty" id="start-right"> </div> | ||
| 40 | {foreach item=oDashlet from=$dashlets_right} | 38 | {foreach item=oDashlet from=$dashlets_right} |
| 41 | <div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}"> | 39 | <div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}"> |
| 42 | <div class="{$oDashlet->sClass}"> | 40 | <div class="{$oDashlet->sClass}"> |