Folder name change bugs out when using same tag twice. fix #377
This commit is contained in:
@@ -926,14 +926,19 @@ Option.Choice = new Class({
|
|||||||
var mtches = []
|
var mtches = []
|
||||||
if(matches)
|
if(matches)
|
||||||
matches.each(function(match, mnr){
|
matches.each(function(match, mnr){
|
||||||
var msplit = value.split(match);
|
var pos = value.indexOf(match),
|
||||||
msplit.each(function(matchsplit, snr){
|
msplit = [value.substr(0, pos), value.substr(pos, match.length), value.substr(pos+match.length)];
|
||||||
if(msplit.length-1 == snr)
|
|
||||||
value = matchsplit;
|
|
||||||
mtches.append([value == matchsplit ? match : matchsplit]);
|
|
||||||
|
|
||||||
if(matches.length*2 == mtches.length)
|
msplit.each(function(matchsplit, snr){
|
||||||
|
if(msplit.length-1 == snr){
|
||||||
|
value = matchsplit;
|
||||||
|
|
||||||
|
if(matches.length-1 == mnr)
|
||||||
mtches.append([value]);
|
mtches.append([value]);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mtches.append([value == matchsplit ? match : matchsplit]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user