Skip to content

Commit

Permalink
* fix refresh Description Count
Browse files Browse the repository at this point in the history
コンテキストメニューからURL短縮などをした際, DescriptionのLength
Countが更新されていなかったのを修正.
なるべくDescription#valueを使うよう変更.
  • Loading branch information
Constellation committed Jan 4, 2010
1 parent 3bc4698 commit 6bb5828
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions xpi/chrome/content/library/40_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ QuickPostForm.descriptionContextMenus = [
name : 'j.mp',
icon : models['j.mp'].ICON,

execute : function(elmText){
shortenUrls(elmText.value, models['j.mp']).addCallback(function(value){
elmText.value = value;
execute : function(elmText, desc){
shortenUrls(desc.value, models['j.mp']).addCallback(function(value){
desc.value = value;
});
},
},
Expand Down
8 changes: 4 additions & 4 deletions xpi/chrome/content/quickPostForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,9 @@ DescriptionBox.prototype = {
},

set value(value){
return this.elmDescription.value = value;
var res = this.elmDescription.value = value;
this.onInput();
return res;
},

get value(){
Expand All @@ -1039,13 +1041,11 @@ DescriptionBox.prototype = {
var value = elm.value;
var start = elm.selectionStart;

elm.value =
this.value =
value.substr(0, elm.selectionStart) +
text +
value.substr(elm.selectionEnd);
elm.selectionStart = elm.selectionEnd = start + text.length;

this.refreshLength();
},

refreshLength : function(){
Expand Down

0 comments on commit 6bb5828

Please sign in to comment.