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 | 1 | YAHOO.example.DDList = function(id, sGroup, config) { |
| 2 | - | |
| 3 | 2 | if (id) { |
| 4 | 3 | this.init(id, sGroup, config); |
| 5 | 4 | this.initFrame(); |
| ... | ... | @@ -56,6 +55,9 @@ YAHOO.example.DDList.prototype.onDragOver = function(e, id) { |
| 56 | 55 | if(p.id != 'dashboard-container-left' && p.id != 'dashboard-container-right') { |
| 57 | 56 | return; |
| 58 | 57 | } |
| 58 | + if(el2.id === 'end-left' || el2.id === 'end-right'){ | |
| 59 | + return; | |
| 60 | + } | |
| 59 | 61 | p.insertBefore(el2, el); |
| 60 | 62 | } |
| 61 | 63 | ... | ... |
resources/js/dashboard.js
| ... | ... | @@ -101,6 +101,12 @@ KTDashboard.prototype = { |
| 101 | 101 | //new YAHOO.util.DD(e.id); |
| 102 | 102 | } |
| 103 | 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 | 110 | new YAHOO.example.DDListBoundary('copyrightbar'); |
| 105 | 111 | new YAHOO.example.DDListBoundary('breadcrumbs'); |
| 106 | 112 | new YAHOO.example.DDListBoundary('bodyLeftRepeat'); |
| ... | ... | @@ -111,6 +117,10 @@ KTDashboard.prototype = { |
| 111 | 117 | 'getDashletBlocks' : function() { |
| 112 | 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 | 125 | 'hideAddButton' : function() { |
| 116 | 126 | hideElement(this.addButton); |
| ... | ... | @@ -298,4 +308,4 @@ addLoadEvent( |
| 298 | 308 | } |
| 299 | 309 | }); |
| 300 | 310 | |
| 301 | - | |
| 302 | 311 | \ No newline at end of file |
| 312 | + | ... | ... |
templates/kt3/dashboard.smarty
| 1 | 1 | <div id="dashboard-container-left"> |
| 2 | - <div class="dashboard_block_empty" id="start-left"> </div> | |
| 3 | 2 | {foreach item=oDashlet from=$dashlets_left} |
| 4 | 3 | <div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}"> |
| 5 | 4 | <div class="{$oDashlet->sClass}"> |
| ... | ... | @@ -36,7 +35,6 @@ |
| 36 | 35 | </div> |
| 37 | 36 | |
| 38 | 37 | <div id="dashboard-container-right"> |
| 39 | - <div class="dashboard_block_empty" id="start-right"> </div> | |
| 40 | 38 | {foreach item=oDashlet from=$dashlets_right} |
| 41 | 39 | <div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}"> |
| 42 | 40 | <div class="{$oDashlet->sClass}"> | ... | ... |