-
-
Save ohadlevy/1480734 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb | |
| index e9af70b..6f66db2 100644 | |
| --- a/app/helpers/application_helper.rb | |
| +++ b/app/helpers/application_helper.rb | |
| @@ -63,7 +63,7 @@ module ApplicationHelper | |
| def link_to_add_puppetclass klass, type | |
| options = klass.name.size > 28 ? {:'data-original-title'=>klass.name, :rel=>'twipsy'} : {} | |
| - content_tag(:span, truncate(klass.name, :length => 28), options).html_safe + | |
| + content_tag(:span, truncate(klass.name, :length => 28), options.merge(:'data-type' => type)).html_safe + | |
| link_to_function("", "add_puppet_class(this)", :'data-class-id'=>klass.id, | |
| :'data-original-title'=>"Click to add #{klass}", :rel=>'twipsy', | |
| :class=>"ui-icon ui-icon-plus") | |
| diff --git a/public/javascripts/host_edit.js b/public/javascripts/host_edit.js | |
| index 93bc998..d299b6a 100644 | |
| --- a/public/javascripts/host_edit.js | |
| +++ b/public/javascripts/host_edit.js | |
| @@ -1,8 +1,9 @@ | |
| function add_puppet_class(item){ | |
| var id = $(item).attr('data-class-id'); | |
| + var type = $(item).attr('data-type'); | |
| var content = $(item).parent().clone(); | |
| content.attr('id', 'selected_puppetclass_'+ id); | |
| - content.append("<input id='host_puppetclass_ids_' name='host[puppetclass_ids][]' type='hidden' value=" +id+ ">"); | |
| + content.append("<input id='" + type +"_puppetclass_ids_' name='" + type +"[puppetclass_ids][]' type='hidden' value=" +id+ ">"); | |
| content.children('span').twipsy(); | |
| var link = content.children('a'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment