Commit d1282765 authored by campaign's avatar campaign

优化了超链接的体验

parent b2102632
......@@ -25,7 +25,11 @@
});
var url = km.queryCommandValue('hyperlink');
$w.find('#hyperlink_href').val(url || '')
var $input = $w.find('#hyperlink_href');
$input.val(url || 'http://');
setTimeout(function(){
$input.focus()
})
},
width: 400
} );
......
......@@ -22,7 +22,7 @@ KityMinder.registerModule( "hyperlink", function () {
}
utils.each( nodes, function ( i, n ) {
if ( n && n.getData( 'hyperlink' ) ) {
result = 1;
result = 0;
return false;
}
} );
......@@ -51,7 +51,17 @@ KityMinder.registerModule( "hyperlink", function () {
if ( nodes.length == 0 ) {
return -1;
}
var link = false;
utils.each( nodes, function ( i, n ) {
if(n.getData( 'hyperlink' )){
link = true;
return false;
}
} );
if(link){
return 0
}
return -1;
}
} )
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment