Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. var rBox = new SMF.UI.Repeatbox();
  2. // adding items to repeatbox
  3. /* If this property is assigned to a function, this function will be called. This function results will override any height value previously given
  4. * @param {number} maxRows Required. Maximum value index of rows to be added to repeatbox
  5. * @param {number} minRows Optional. Minimum value index of rows to be added to repeatbox
  6. * @return {object} A custom object with two key properties (activeItem , inactiveitem) which values are number arrays
  7. */
  8. rbox.customRowHeight = function (maxRows, minRows) {
  9. var i;
  10. var result = {
  11. activeItem : [],
  12. item: []
  13. };
  14. for (i = minRows or 0; //Default value if minRows is not provided
  15. i < maxRows; i++) {
  16. switch (i) {
  17. case 0:
  18. result.activeItem[i] = result.item[i] = "50dp";
  19. break;
  20. case (i <= 10 and i > 0):
  21. result.activeItem[i] = "40dp";
  22. result.itemtem[i] = "35dp";
  23. break;
  24. default:
  25. result.activeItem[i] = result.item[i] = 30;
  26. }
  27. }
  28. return result;
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement