Photo resizes

677
3
12-06-2016 12:31 PM
AmyKlug
Occasional Contributor III

I imbedded a photo (of a legend) into the "about" widget and the strangest thing happens, every time I leave that tab to go to another tab and come back the photo get's smaller. Do this several times and it almost disappears. ????? anyone seen this before or how to fix it?

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Amy,

   I am not seeing that issue at all. What version of WAB are you using?

0 Kudos
AmyKlug
Occasional Contributor III

I am using 2.2. my images are over 400*400. When I make them smaller they work fine. I think I can break the legend up into smaller pieces, I hope.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Amy,

   The widget dialog warns that images larger then 400 x 400 will be automatically resized. This is the function in the about widget Widget.js that does that: You could always comment out some code.

      _resizeContentImg: function() {
        var customBox = html.getContentBox(this.customContentNode);

        if (this._hasContent) {
          html.empty(this.customContentNode);

          var aboutContent = html.toDom(this.config.about.aboutContent);
          html.place(aboutContent, this.customContentNode);
          // single node only(no DocumentFragment)
          if (this.customContentNode.nodeType && this.customContentNode.nodeType === 1) {
            var contentImgs = query('img', this.customContentNode);
            if (contentImgs && contentImgs.length) {
              contentImgs.style({
                maxWidth: (customBox.w - 20) + 'px', // prevent x scroll
                maxHeight: (customBox.h - 40) + 'px'
              });
            }
          }
        }
      }
0 Kudos