2

I am trying to create a card that would have action on clicking "select" button and still have scrollable text, something like:

var card = new UI.Card({
  title: 'Title',
  body: 'long text goes here...',
  action: {
    select: 'images/refresh.png',
    backgroundColor: 'white'
  },
  scrollable: true
});

card.on('click', function(e) {
  if (e.button == 'select') {
      //some code
  } 
});

if executed like this - icon in action bar is visible and "click" event runs, but "scrollable: true" no longer has effect. If I comment "action" property - "click" event still runs and this time "scrollable: true" is working, but of course no icon is displayed. Is it a bug or is it by design? How can I have best of both worlds - display icon for "select" and keep card scrollable?

1 Answer 1

3

Thanks to this question, I've made a commit that will allow you to use the action bar layer and scroll layer at the same time: https://github.com/pebble/pebblejs/commit/04f926f137395a0ebd0faaab8b0722da9aa75a7d.

I'll update this answer when the commit is merged into CloudPebble.

1
  • Thanks for the quick turnaround! I know that Pebble.js is a beta and pretty much work in progress, so I really appreciate the response and the work you do.
    – suff trek
    Commented Oct 30, 2014 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.