3

I am trying to zoom on a Panel with HTML inside of it.

Ext.define('Sencha.view.Detail_content', {
    extend: 'Ext.Panel',
    xtype: 'detailcontenttpl',
    config: {
        layout: {  type: "fit" },
        scrollable: true,
        styleHtmlContent: true,
        id: 'detail_content_wrap',
        tpl : [
            "<p class='detail_contentDate'>{date}</p>",
            "<div class='messageWrap'>{message}</div>"
        ],
        listeners: {
            pinchstart: {
                element: 'innerElement',
                fn: function(e, t) {
                    this.startScale = e.scale;
                }
            },
            pinch: {
                element: 'innerElement',
                fn: function(e, t) {
                    e.preventDefault();
                    this.scale = e.scale * this.startScale;
                    var p = t.parentNode;
                    Ext.fly(p).setStyle('-webkit-transform', 'scale('+this.scale+')');
                }
            }
        }
    }
});

It kind of works, but doesn't work as intended. It breaks the scroller, and it doesn't work all the time.

I am thinking Ext.fly(p).setStyle('-webkit-transform', 'scale('+this.scale+')'); should be set on something else, but I have tried every parent element, still failed.

I understand there are some examples available, but most of them deal with images, not Panel with HTML.

What am I doing wrong?

fractious
  • 1,642
  • 16
  • 30
tpae
  • 6,286
  • 2
  • 37
  • 64

0 Answers0