Commits

Anonymous committed 756a27e

fix default link type display.

Comments (0)

Files changed (1)

static/js/src/page.js

 
           this.toolbar.addButton('Link',function(){
               var selection = this.getSelection();
+              
+              
+              function display_link_type(selected) {
+                  $('link_from_'+ selected).show();
+                  $('link_from_'+self.link_types_hide[selected]).hide();
+              }
+              
               self.link_window.open();
-              $('link_from_url').hide();
+              display_link_type($('link_type').getValue())
+              
               $("cancelLink").observe("click", function(e) {
                   Event.stop(e);
                   self.link_window.close();
               
               $('link_type').observe('change', function(e) {
                   var selected = this.getValue();
+                  display_link_type(selected)
                   
-                  $('link_from_'+ selected).show();
-                  $('link_from_'+self.link_types_hide[selected]).hide();
                   
               }, false);