Permalink
Browse files

added functionality for issue #144

  • Loading branch information...
1 parent e6435c6 commit 08d1f4446ef00f0b4e996d60e3aee92d6183d63a Tim Neil committed Jun 11, 2012
Showing with 113 additions and 23 deletions.
  1. +1 −0 CHANGELOG.md
  2. +35 −5 pkg/bbui-0.9.3.js
  3. +8 −8 samples/arrowList.htm
  4. +35 −5 samples/bbui-0.9.3.js
  5. +34 −5 src/plugins/imageList.js
View
@@ -19,6 +19,7 @@ Below you will find all the different changes that have been added since the fir
* Now supports (default | arrowlist | arrowbuttons | addbuttons | removebuttons) styling
* Added JavaScript interface to list and items
* Onbtnclick events are now availble for image lists that have secondary action buttons
+ * Now re-adjust alignment when no description is given
* File Input: BlackBerry 10 button styling to input of type "file"
* Buttons: setCaption() function to buttons
* Activity Indicator: Added new BlackBerry 10 Activity Indicator
View
@@ -1980,10 +1980,6 @@ bb.imageList = {
descriptionDiv = document.createElement('div');
descriptionDiv.setAttribute('class','description');
details.description = descriptionDiv;
- if (description.length == 0) {
- description = ' ';
- }
- descriptionDiv.innerHTML = description;
details.appendChild(descriptionDiv);
// Add our highlight overlay
@@ -2065,6 +2061,7 @@ bb.imageList = {
btnBorder.style['background'] = 'transparent';
btnBorder.style['border-color'] = 'transparent';
}
+
// Set our class
btnInner.setAttribute('class',btnInner.normal);
} else {
@@ -2078,6 +2075,22 @@ bb.imageList = {
}
}
+ // Adjust the description description
+ if (description.length == 0) {
+ description = ' ';
+ descriptionDiv.style.visibilty = 'hidden';
+ // Center the title if no description is given
+ title.style['margin-top'] = (bb.device.isPlayBook) ? '17px' : '32px';
+ // Adjust highlight overlay
+ overlay.style['margin-top'] = (bb.device.isPlayBook) ? '-73px' : '-136px';
+ // Adjust accent text
+ if (accentText) {
+ accentText.style['margin-top'] = (bb.device.isPlayBook) ? '-52px' : '-90px';
+ }
+ }
+ descriptionDiv.innerHTML = description;
+
+
// Apply our details class
details.setAttribute('class',detailsClass);
@@ -2347,10 +2360,27 @@ bb.imageList = {
// Add the description
descriptionDiv = document.createElement('div');
- descriptionDiv.innerHTML = description;
descriptionDiv.className = 'description';
details.appendChild(descriptionDiv);
+ // Adjust the description description
+ if (description.length == 0) {
+ description = ' ';
+ descriptionDiv.style.visibilty = 'hidden';
+ // Center the title if no description is given
+ titleDiv.style['margin-top'] = (bb.device.isHiRes) ? '14px' : '18px';
+ // Adjust accent text
+ if (accentDiv) {
+ accentDiv.style['margin-top'] = (bb.device.isHiRes) ? '-32px' : '-25px';
+ }
+ // Adjust any arrows
+ if (this.listStyle == 'arrowlist') {
+ btn.style['margin-top'] = (bb.device.isHiRes) ? '-73px' : '-70px';
+
+ }
+ }
+ descriptionDiv.innerHTML = description;
+
// Add the remove function for the item
innerChildNode.remove = function() {
this.parentNode.removeChild(this);
View
@@ -21,14 +21,14 @@
</div>
<!--<div data-bb-type="round-panel" id="mainList">-->
<div data-bb-type="image-list" data-bb-images="none" data-bb-style="arrowlist">
- <div data-bb-type="item" data-bb-title="This shows what happens when the text is too long to fit on a line">description</div>
- <div data-bb-type="item" data-bb-title="Sleepy">Sleepy</div>
- <div data-bb-type="item" data-bb-title="Sneezy">Sneezy</div>
- <div data-bb-type="item" data-bb-title="Dopey">Dopey</div>
- <div data-bb-type="item" data-bb-title="Grumpy">Grumpy</div>
- <div data-bb-type="item" data-bb-title="Doc">Doc</div>
- <div data-bb-type="item" data-bb-title="Bashful">Bashful</div>
- <div data-bb-type="item" data-bb-title="Happy">Happy</div>
+ <div data-bb-type="item" data-bb-title="This shows what happens when the text is too long to fit on a line"></div>
+ <div data-bb-type="item" data-bb-title="Sleepy">With a description</div>
+ <div data-bb-type="item" data-bb-title="Sneezy"></div>
+ <div data-bb-type="item" data-bb-title="Dopey"></div>
+ <div data-bb-type="item" data-bb-title="Grumpy"></div>
+ <div data-bb-type="item" data-bb-title="Doc"></div>
+ <div data-bb-type="item" data-bb-title="Bashful"></div>
+ <div data-bb-type="item" data-bb-title="Happy"></div>
</div>
<!--</div>-->
<div data-bb-type="action-bar" data-bb-back-caption="Back"></div>
View
@@ -1980,10 +1980,6 @@ bb.imageList = {
descriptionDiv = document.createElement('div');
descriptionDiv.setAttribute('class','description');
details.description = descriptionDiv;
- if (description.length == 0) {
- description = '&nbsp;';
- }
- descriptionDiv.innerHTML = description;
details.appendChild(descriptionDiv);
// Add our highlight overlay
@@ -2065,6 +2061,7 @@ bb.imageList = {
btnBorder.style['background'] = 'transparent';
btnBorder.style['border-color'] = 'transparent';
}
+
// Set our class
btnInner.setAttribute('class',btnInner.normal);
} else {
@@ -2078,6 +2075,22 @@ bb.imageList = {
}
}
+ // Adjust the description description
+ if (description.length == 0) {
+ description = '&nbsp;';
+ descriptionDiv.style.visibilty = 'hidden';
+ // Center the title if no description is given
+ title.style['margin-top'] = (bb.device.isPlayBook) ? '17px' : '32px';
+ // Adjust highlight overlay
+ overlay.style['margin-top'] = (bb.device.isPlayBook) ? '-73px' : '-136px';
+ // Adjust accent text
+ if (accentText) {
+ accentText.style['margin-top'] = (bb.device.isPlayBook) ? '-52px' : '-90px';
+ }
+ }
+ descriptionDiv.innerHTML = description;
+
+
// Apply our details class
details.setAttribute('class',detailsClass);
@@ -2347,10 +2360,27 @@ bb.imageList = {
// Add the description
descriptionDiv = document.createElement('div');
- descriptionDiv.innerHTML = description;
descriptionDiv.className = 'description';
details.appendChild(descriptionDiv);
+ // Adjust the description description
+ if (description.length == 0) {
+ description = '&nbsp;';
+ descriptionDiv.style.visibilty = 'hidden';
+ // Center the title if no description is given
+ titleDiv.style['margin-top'] = (bb.device.isHiRes) ? '14px' : '18px';
+ // Adjust accent text
+ if (accentDiv) {
+ accentDiv.style['margin-top'] = (bb.device.isHiRes) ? '-32px' : '-25px';
+ }
+ // Adjust any arrows
+ if (this.listStyle == 'arrowlist') {
+ btn.style['margin-top'] = (bb.device.isHiRes) ? '-73px' : '-70px';
+
+ }
+ }
+ descriptionDiv.innerHTML = description;
+
// Add the remove function for the item
innerChildNode.remove = function() {
this.parentNode.removeChild(this);
View
@@ -148,10 +148,6 @@ bb.imageList = {
descriptionDiv = document.createElement('div');
descriptionDiv.setAttribute('class','description');
details.description = descriptionDiv;
- if (description.length == 0) {
- description = '&nbsp;';
- }
- descriptionDiv.innerHTML = description;
details.appendChild(descriptionDiv);
// Add our highlight overlay
@@ -233,6 +229,7 @@ bb.imageList = {
btnBorder.style['background'] = 'transparent';
btnBorder.style['border-color'] = 'transparent';
}
+
// Set our class
btnInner.setAttribute('class',btnInner.normal);
} else {
@@ -246,6 +243,22 @@ bb.imageList = {
}
}
+ // Adjust the description description
+ if (description.length == 0) {
+ description = '&nbsp;';
+ descriptionDiv.style.visibilty = 'hidden';
+ // Center the title if no description is given
+ title.style['margin-top'] = (bb.device.isPlayBook) ? '17px' : '32px';
+ // Adjust highlight overlay
+ overlay.style['margin-top'] = (bb.device.isPlayBook) ? '-73px' : '-136px';
+ // Adjust accent text
+ if (accentText) {
+ accentText.style['margin-top'] = (bb.device.isPlayBook) ? '-52px' : '-90px';
+ }
+ }
+ descriptionDiv.innerHTML = description;
+
+
// Apply our details class
details.setAttribute('class',detailsClass);
@@ -515,10 +528,26 @@ bb.imageList = {
// Add the description
descriptionDiv = document.createElement('div');
- descriptionDiv.innerHTML = description;
descriptionDiv.className = 'description';
details.appendChild(descriptionDiv);
+ // Adjust the description description
+ if (description.length == 0) {
+ description = '&nbsp;';
+ descriptionDiv.style.visibilty = 'hidden';
+ // Center the title if no description is given
+ titleDiv.style['margin-top'] = (bb.device.isHiRes) ? '14px' : '18px';
+ // Adjust accent text
+ if (accentDiv) {
+ accentDiv.style['margin-top'] = (bb.device.isHiRes) ? '-32px' : '-25px';
+ }
+ // Adjust any arrows
+ if (this.listStyle == 'arrowlist') {
+ btn.style['margin-top'] = (bb.device.isHiRes) ? '-73px' : '-70px';
+ }
+ }
+ descriptionDiv.innerHTML = description;
+
// Add the remove function for the item
innerChildNode.remove = function() {
this.parentNode.removeChild(this);

0 comments on commit 08d1f44

Please sign in to comment.