Resolved color tool load issue

This commit is contained in:
Fluidbyte
2012-09-20 11:02:36 -07:00
parent 2630b00785
commit 5a2eb52cf5
2 changed files with 14 additions and 2 deletions

View File

@@ -210,7 +210,13 @@ var active = {
//////////////////////////////////////////////////////////////////
get_selected_text : function(){
return editor.get_selected_text(active.get_id());
var path = this.get_path();
var id = this.get_id();
if(path && id){
return editor.get_selected_text(active.get_id());
}else{
message.error('No Open Files or Selected Text');
}
},
//////////////////////////////////////////////////////////////////

View File

@@ -17,7 +17,13 @@
$(function(){
selected = active.get_selected_text();
sellength = selected.length;
if(selected==null){
selected = '#45818a';
sellength = 7;
}else{
sellength = selected.length;
}
var colorRegEx = /^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$/;
seltest = colorRegEx.test(selected);