diff --git a/o2web/source/o2_core/o2/widget/AttachmentController.js b/o2web/source/o2_core/o2/widget/AttachmentController.js index 84f11964cb1c7a7765f5cf6c165cb6f062c156d7..e2437ec1a92cabe46ce511885ff8707ea79b39bd 100644 --- a/o2web/source/o2_core/o2/widget/AttachmentController.js +++ b/o2web/source/o2_core/o2/widget/AttachmentController.js @@ -1153,11 +1153,11 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({ return names; }, - addAttachment: function(data, messageId){ + addAttachment: function(data, messageId, isCheckPosition){ if (this.options.size=="min"){ - this.attachments.push(new o2.widget.AttachmentController.AttachmentMin(data, this, messageId)); + this.attachments.push(new o2.widget.AttachmentController.AttachmentMin(data, this, messageId, isCheckPosition)); }else{ - this.attachments.push(new o2.widget.AttachmentController.Attachment(data, this, messageId)); + this.attachments.push(new o2.widget.AttachmentController.Attachment(data, this, messageId, isCheckPosition)); } this.checkActions(); }, @@ -1190,7 +1190,7 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({ o2.widget.AttachmentController.Attachment = new Class({ Implements: [Events], - initialize: function(data, controller, messageId){ + initialize: function(data, controller, messageId, isCheckPosition){ this.data = data; if( !this.data.person && this.data.creatorUid )this.data.person = this.data.creatorUid; @@ -1201,6 +1201,7 @@ o2.widget.AttachmentController.Attachment = new Class({ this.content = this.controller.content; this.isSelected = false; this.seq = this.controller.attachments.length+1; + this.isCheckPosition = isCheckPosition; this.actions = []; if (messageId && this.controller.messageItemList) { @@ -1216,6 +1217,9 @@ o2.widget.AttachmentController.Attachment = new Class({ "par": "@url#"+url }; }, + isNumber : function( d ){ + return parseFloat(d).toString() !== "NaN" + }, load: function(){ if (this.message){ this.node = new Element("div").inject(this.message.node, "after"); @@ -1224,6 +1228,16 @@ o2.widget.AttachmentController.Attachment = new Class({ }else{ this.node = new Element("div").inject(this.content); } + if( this.isCheckPosition && this.isNumber(this.data.orderNumber) ){ + var attList = this.controller.attachments; + for( var i=0; i