Folder name change bugs out when using same tag twice. fix #377

This commit is contained in:
Ruud
2012-06-10 17:08:15 +02:00
parent eeaf4c5ac8
commit eafffaab76
+12 -7
View File
@@ -926,14 +926,19 @@ Option.Choice = new Class({
var mtches = []
if(matches)
matches.each(function(match, mnr){
var msplit = value.split(match);
msplit.each(function(matchsplit, snr){
if(msplit.length-1 == snr)
value = matchsplit;
mtches.append([value == matchsplit ? match : matchsplit]);
var pos = value.indexOf(match),
msplit = [value.substr(0, pos), value.substr(pos, match.length), value.substr(pos+match.length)];
if(matches.length*2 == mtches.length)
mtches.append([value]);
msplit.each(function(matchsplit, snr){
if(msplit.length-1 == snr){
value = matchsplit;
if(matches.length-1 == mnr)
mtches.append([value]);
return;
}
mtches.append([value == matchsplit ? match : matchsplit]);
});
});