app/assets/javascripts/familiarity/familiarity_admin.js.erb in familiarity-0.2.2 vs app/assets/javascripts/familiarity/familiarity_admin.js.erb in familiarity-0.2.4

- old
+ new

@@ -1,43 +1,20 @@ -jQuery.fn.getPath = function () { - if (this.length != 1) throw 'Requires one element.'; - - var path, node = this; - while (node.length) { - var realNode = node[0], name = realNode.localName; - if (!name) break; - name = name.toLowerCase(); - - var parent = node.parent(); - - var siblings = parent.children(name); - if (siblings.length > 1) { - name += ':eq(' + siblings.index(realNode) + ')'; - } - - path = name + (path ? '>' + path : ''); - node = parent; - } - - return path; -}; - var FamiliarityAdmin = function () { this.familiarityEditorialSet = {}; this.familiaritySaveUrl = '<%=Familiarity::Engine.routes.url_helpers.save_familiarities_path(format: :json)%>'; this.familiaritiesUrl = '<%= Familiarity::Engine.routes.url_helpers.familiarities_path(format: :json) %>'; } -FamiliarityAdmin.familiaritySwitchBoard = function () { +FamiliarityAdmin.familiaritySwitchBoard = function (options) { var familiarity_admin = new FamiliarityAdmin(); var switch_state = 'On'; $('div.familiaritySwitch').remove(); var _div = $('<div class="familiaritySwitch"></div>').html('<div class="text_content">Switch ' + switch_state + ' familiarity!</div>').click(function () { familiarity_admin.familiaritySwitch(switch_state); switch_state = (switch_state == "On") ? "Off" : "On"; $(this).html('<div class="text_content">Switch ' + switch_state + ' familiarity!</div>'); - }).appendTo($('body')); + }).appendTo($('body')).addClass("fs_"+options.position); } FamiliarityAdmin.prototype = { findOrBuildPopup: function (selection_path, inner_text) { if (typeof(inner_text) == 'undefined') { \ No newline at end of file