From 2f5fc2f4e1a4d0e4bb3bf0f5016e43a3f1fcdb3b Mon Sep 17 00:00:00 2001 From: Kaleb Murphy Date: Wed, 15 Apr 2009 19:10:41 +0000 Subject: [PATCH] Survey editor now keeps survye objedts in a scrollable panel to keep buttons always in view. --- docs/changelog/7.x.x.txt | 1 + ...ot_import_survey_default-survey-edit.wgpkg | Bin 0 -> 1862 bytes www/extras/wobject/Survey/dd.js | 22 ++++++++++++++---- www/extras/wobject/Survey/editsurvey.js | 20 ++++++++++++++-- 4 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 docs/upgrades/packages-7.7.4/root_import_survey_default-survey-edit.wgpkg diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7027d0aa1..cbbfcc923 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -20,6 +20,7 @@ - fixed #9039: Synopsis not output as a meta field - fixed #9939: checkout error with any payment method - fixed #10162: Inbox Failing (Eric Kennedy) + - Survey editor now keeps survye objedts in a scrollable panel to keep buttons always in view. 7.7.3 - fixed #10094: double explanation in thread help diff --git a/docs/upgrades/packages-7.7.4/root_import_survey_default-survey-edit.wgpkg b/docs/upgrades/packages-7.7.4/root_import_survey_default-survey-edit.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..be9e8f2c65473e837fbdf39f2bf9c3e605e103a9 GIT binary patch literal 1862 zcmV-M2f6qkiwFP!000001ML`VliRlOKIc~;%8Z=Mn4+Z9MV3ro#_=P**1lfiySi?){bbu0hoqEkT!B75Q261nHn+2g7EYWmzsN?L{d_b~@8D ziO~~f%u{6H$32s(bzowxgqVX2 zq_-(}pqb&nGSZtTn$!3i{YNH2 ztc23jFBXf%4o;=jL4WJ0o@?n$?gOQbLT9$h6&rT543GW7fsOpexjJ z3CkIiMc0R4*Fc683{{|Xx3FA*pEJ{aadzI7NO=x~NDwr3hA`&2-Ey8cbVdC#xP;O1 zjV@Hv4(m6lR?v%1!E+ta|D8!AaM-*$kG*wPZOw=6kHfI5jT+W(hhc=y5#sGIJH8T0x-)C&&B_#Zi`RzOS&l$Mqyo_qMajG-o?-x7)a#=i#7Zw2k=WS>%iI@622ll z0j!Lg>wpTeRVYR^SSX71VSs2Z;{&8l_fWg+B5si>;njgETF`s&n8JT+2bqxPo?EZi zs}AZ5q#dSV`#Y+?a8I=_qC`UN3X=W*Gd}Xf0z+u+4L3 zfqq$Z^+1Z9(tR{JzUzy6EZ6BN`FBMHHoC*`1u@JRs7!lst{zRGIQyG)OtAoMsDHC4 zWc&c5WS`B+_~gTE!jexT$R1ToubD5X_G#ZiAn}oT=kA?$3v$N`Rf*K-A8l2y){e2J zT7n0eKtcIknH)q+hr4R4F!vfBK&|LHf7qi9=iffY_E)vpd28j3Yo)I#wAZk=f;-}t z&Y>r3FZpGC8rh~5#I@>*3gO+U>YTv6DlQ2$`p|!)^`fv4`*cGf3N4-9hrrrR9IKG? ze_~T|D!=xq;29&6Q;8>pUhk!E?tmpOeiZ%tfv=1 zvSo)7)NZ@l>nq0_-k*=ieF%K)c1tsZ6Jt(DmJf zuA0*|6rF*wJ$C~HAMMkri<9Z}vYH`m4`d!eAH4j~H0Om%_=3Zn#t$TpC-;WK$zalO zbZx(bKKA1f;)9nwf$Y$rm9ve%bLQte;|9bHqM}+olLi96iTqqyH~=JOu(yM^bc1!} zB@Qb-&L2llg_{I*XbxkoReSX067WkHA2>Rr{;)N#$#F`e9pD4%oKBxzzIeW`TyCDL z__|W;)*y_VQdzqaxd~Zm5C@w~#*@j(c-WF!vlYi2{kR$j4Tk$>;pPG+0+r*mE@2%V+g+&Y$}%W|Z)UY;-h@~jZqzq0hz86?@& z (dy + temp.offsetHeight)){ + Survey.Data.ddContainer.body.scrollTop += 20; + } if (y < this.lastY) { this.goingUp = true; } else if (y > this.lastY) { @@ -92,12 +105,13 @@ YAHOO.extend(Survey.DDList, YAHOO.util.DDProxy, { // We are only concerned with list items, we ignore the dragover // notifications for the list. if (destEl.nodeName.toLowerCase() == "li") { -currentDest = destEl; -YAHOO.log(destEl); + currentDest = destEl; + YAHOO.log(destEl); var orig_p = srcEl.parentNode; var p = destEl.parentNode; if (this.goingUp) { + Survey.Data.ddContainer p.insertBefore(srcEl, destEl); // insert above } else { p.insertBefore(srcEl, destEl.nextSibling); // insert below diff --git a/www/extras/wobject/Survey/editsurvey.js b/www/extras/wobject/Survey/editsurvey.js index 509e231f6..4425d5d59 100644 --- a/www/extras/wobject/Survey/editsurvey.js +++ b/www/extras/wobject/Survey/editsurvey.js @@ -15,8 +15,8 @@ Survey.Data = (function(){ var sButton, qButton, aButton; return { + ddContainer:null, dragDrop: function(did){ - YAHOO.log('In drag drop'); var type = did.className.match("section") ? 'section' : did.className.match("question") ? 'question' @@ -80,7 +80,23 @@ Survey.Data = (function(){ YAHOO.util.Event.purgeElement('sections', true); // Now we can re-write its innerHTML without fear of memory leaks - document.getElementById('sections').innerHTML = d.ddhtml; +// document.getElementById('sections').innerHTML = d.ddhtml; + + if(! Survey.Data.ddContainer){ + Survey.Data.ddContainer = + new YAHOO.widget.Panel("sections", + { width:"440px", + height: "420px", + draggable:true, + visible:true + + } + ); + } + Survey.Data.ddContainer.setHeader("Survey Objects..."); + Survey.Data.ddContainer.setBody(d.ddhtml); + Survey.Data.ddContainer.setFooter(document.getElementById("buttons")); + Survey.Data.ddContainer.render();//document.body); //add event handlers for if a tag is clicked for (var x in d.ids) {