Результаты поиска
Введите запрос, по завершению нажмите Enter.
  • Страница 1 из 1
  • 1
autosize uWnd
Отправлено 20.02.2012 - 18:571
Нет аватара
Бывалый
380 сообщений
Мужчина
мужики, все мы сталкивались с проблемой, когда uWnd окно меньше размеров контента внутри него и приходилось ждать пока оно автоматически (если стоит autosize:1) розтянется, так вот, может кто знает как эту беду исправить, так что бы окошко появлялось уже автомизированых размеров без этой медленной "анимации"
вот код который за это отвечает

Code
checksize: function () {
   var h = this.autosz,
   i = this.parts.wndcont;
   h.inittimer = null;
   if (this.state.maximized || this.state.minimized) {
    return
   }
   if (!this.state.visible) {
    h.startonshow = 1;
    return
   }
   h.startonshow = 0;
   this.stopdrag();
   this.stopresize();
   if (h.load) {
    h.load = false;
    if (h.images) {
     $(h.images).unbind();
     h.images = null
    }
    if (this.props.autosizeonimages) {
     if (!_uWnd.autosizeonimagesfunc) {
      _uWnd.autosizeonimagesfunc = function (a) {
       a.data.delaychecksize()
      }
     }
     h.images = $(i).find("img").bind("load", this, _uWnd.autosizeonimagesfunc)
    }
   }
   h.active = true;
   h.speed = 100;
   h.speedmult = this.props.autosizestepmult;
   this.design.onstartautosz(this);
   if (h.timer) {
    clearTimeout(h.timer);
    h.timer = null
   }
   var f = _uWnd.getdims(),
   k = 10,
   e = 10,
   g,
   c;
   if (this.props.header) {
    k += this._countbuttonwidth()
   }
   k = Math.max(k, this.minwidth);
   e = Math.max(e, this.minheight);
   g = this.maxwidth;
   if (g == 0) {
    g = f.clientW - this.decor.w
   }
   c = this.maxheight;
   if (c == 0) {
    c = f.clientH - this.decor.h
   }
   var b, j;
   if (this.props.autosizewidth) {
    $(this.parts.wndcont).css("width", "10px");
    b = i.scrollWidth;
    $(this.parts.wndcont).css({
     width: (this.width - this.decor.w) + "px"
    })
   } else {
    b = i.scrollWidth
   }
   j = i.scrollHeight + 1;
   h.tw = Math.max(b, k);
   h.th = Math.max(j, e);
   var l = false;
   if (h.tw > g) {
    h.tw = g;
    h.th += this.decor.sbh;
    l = true
   }
   if (h.th > c) {
    h.th = c;
    if (h.tw + this.decor.sbw <= g) {
     h.tw += this.decor.sbw;
     l = true
    } else {
     h.tw = g
    }
   }
   if (l) {
    this.design.onstopautosz(this, true)
   }
   h.timer = setTimeout("try{_uWnd.all[" + this.idx + "]._checksize();}catch(e){}", 10)
  },
  _checksize: function () {
   this.stopdrag();
   this.stopresize();
   var c = this.autosz,
   d = c.tw - (this.width - this.decor.w),
   f = c.th - (this.height - this.decor.h),
   b = this.props.autosizestep * c.speed,
   e = this.props.autosizestep * c.speed;
   if (b <= 0) {
    b = 1
   }
   if (e <= 0) {
    e = 1
   }
   c.speed *= c.speedmult;
   c.speedmult *= this.props.autosizestepmultmult;
   if (d != 0) {
    if (d > 0) {
     b = Math.min(b, d)
    } else {
     if (d < 0) {
      b = Math.max( - b, d)
     }
    }
    if (this.props.autosizewidth == 2 && f != 0) {
     if (f > 0) {
      e = Math.min(e, f)
     } else {
      if (f < 0) {
       e = Math.max( - e, f)
      }
     }
    } else {
     e = 0
    }
    this.resizeTo(this.width + b, this.height + e, true, 1)
   } else {
    if (f != 0) {
     if (f > 0) {
      e = Math.min(e, f)
     } else {
      if (f < 0) {
       e = Math.max( - e, f)
      }
     }
     this.resizeTo(this.width, this.height + e, true, 1)
    } else {
     c.timer = null;
     c.active = false;
     this.design.onstopautosz(this);
     return
    }
   }
   c.timer = setTimeout("try{_uWnd.all[" + this.idx + "]._checksize();}catch(e){}", 10)
  }
clapp

Добавлено (20.02.2012, 18:57)
---------------------------------------------
up

Профиль Личное сообщение Дом. страница icq Skype
59
  • Страница 1 из 1
  • 1
Поиск:
uSite.su © 2010-2026
Все права защищены.
Многогранность и сверхспособности сообщества uCoz заставляют задуматься даже самые стойкие умы веб-программирования, ведь лишь uSite способен предоставить ответы на самые сложные вопросы uCoz.
01RSS
Хостинг от uCozПользовательское соглашение и прочая информация