本帖最后由 u011642368 于 2013-09-29 10:50:33 编辑

解决方案 »

  1.   

    你是不是多次邦定 click了没代码不好说
      

  2.   

     _openDialog: function(e) {
            var initSearchButton,
              _this = this;
            this.lastSelection = this.options.editable.getSelection();
            this.options.dialog.dialog("open");
            this.options.dialog.dialog("option", "title", "已上传图片");
    this.options.dialog.dialog("option", "position", [e.pageX-150,e.pageY+30]);
    _this._search();
            this.options.dialog.on('dialogclose', function() {
              return _this.options.editable.element.focus();
            });
            if (this.container == null) {
              this.container = jQuery("#hallo-image-browser-container-" + this.options.uuid);
            }
            if (this.paging == null) {
              this.paging = jQuery('.hallo-image-browser-paging', this.container);
            }
            if (this.pagingback == null) {
              this.pagingback = jQuery('.hallo-image-browser-paging-back', this.container);
            }
            if (this.pagingforward == null) {
              this.pagingforward = jQuery('.hallo-image-browser-paging-forward', this.container);
            }
            this.pagingback.on("click", function() {
             if($('.hallo-image-browser-paging-back').hasClass("disabled")){
               return;
             }else{
                console.log("funck");
                _this.currentpage--;
                return _this._search();
             }
            });
            this.pagingforward.on("click", function() {
             if($('.hallo-image-browser-paging-forward').hasClass("disabled")){
               return;
             }else{
                console.log("funck");
                  _this.currentpage++;
                  return _this._search();
             }
            });
            if (this.noresult == null) {
              this.noresult = jQuery('.hallo-image-browser-no-search-result', this.container);
            }
            if (this.searchvalue == null) {
              this.searchvalue = this.options.dialog.find('.hallo-image-browser-search-value');
            }
            initSearchButton = function() {
              _this.searchbutton = _this.options.dialog.find('.hallo-image-browser-search');
              return _this.searchbutton.on("click", function() {
                return _this._search();
              });
            };
            return this.searchbutton != null ? this.searchbutton : this.searchbutton = initSearchButton();
          },
          _search: function() {
            var data, query,
              _this = this;
              window.console.log(this.currentpage);
        //    query = this.searchvalue.val();
            if (this.lastquery !== query) {
              this.currentpage = 1;
              this.lastquery = query;
            }
            data = {
              limit: this.options.limit,
              page: this.currentpage,
              query: query
            };
            return jQuery.getJSON(this.options.searchurl, data, function(data) {
              _this._resetSearchResults();
              _this._paging(data.page, data.total);
              return _this._preview_images(data.results);
            });
          }
      

  3.   

    加上 防止事件冒泡 试试         this.pagingback.on("click", function(evt) {
             evt.stopPropagation();
             if($('.hallo-image-browser-paging-back').hasClass("disabled")){
               return;
             }else{
                console.log("funck");
                _this.currentpage--;
                return _this._search();
             }
            });
            this.pagingforward.on("click", function(evt) {
             evt.stopPropagation();
             if($('.hallo-image-browser-paging-forward').hasClass("disabled")){
               return;
             }else{
                console.log("funck");
                  _this.currentpage++;
                  return _this._search();
             }
            });
      

  4.   

    你不要把  this.pagingback.on("click", this.pagingforward.on("click", 放在 _openDialog 里 或者 判断一下是否初始         if(!this.isInit){
             this.isInit=true;
            this.pagingback.on("click", function(evt) {
             evt.stopPropagation();
             if($('.hallo-image-browser-paging-back').hasClass("disabled")){
               return;
             }else{
                console.log("funck");
                _this.currentpage--;
                return _this._search();
             }
            });
            this.pagingforward.on("click", function(evt) {
             evt.stopPropagation();
             if($('.hallo-image-browser-paging-forward').hasClass("disabled")){
               return;
             }else{
                console.log("funck");
                  _this.currentpage++;
                  return _this._search();
             }
            });
            
             }