From 0b7f9ef7dd059e550240237f171a1431eacf29b5 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 23 Feb 2013 18:57:54 +0100 Subject: #2012 - Clean up gallery.in_place_edit.js. - removed extend similar to previous jQuery updates (doesn't work the same with jQuery 1.4+) --- lib/gallery.in_place_edit.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/gallery.in_place_edit.js b/lib/gallery.in_place_edit.js index 5a815dac..48c86739 100644 --- a/lib/gallery.in_place_edit.js +++ b/lib/gallery.in_place_edit.js @@ -1,5 +1,7 @@ (function($) { $.widget("ui.gallery_in_place_edit", { + options: {}, + _init: function() { var self = this; this.element.click(function(event) { @@ -68,8 +70,4 @@ }); } }); - - $.extend($.ui.gallery_in_place_edit, { - defaults: {} - }); })(jQuery); -- cgit v1.2.3 From f13f8b4a328891c63f3b8d83ccd126bca3961b0c Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 23 Feb 2013 18:59:30 +0100 Subject: #2012 - Clean up gallery.in_place_edit.js (formatting only) - removed extra leading whitespaces --- lib/gallery.in_place_edit.js | 128 +++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 64 deletions(-) (limited to 'lib') diff --git a/lib/gallery.in_place_edit.js b/lib/gallery.in_place_edit.js index 48c86739..86a58856 100644 --- a/lib/gallery.in_place_edit.js +++ b/lib/gallery.in_place_edit.js @@ -1,73 +1,73 @@ (function($) { - $.widget("ui.gallery_in_place_edit", { - options: {}, + $.widget("ui.gallery_in_place_edit", { + options: {}, - _init: function() { - var self = this; - this.element.click(function(event) { - event.preventDefault(); - self._show(event.currentTarget); - return false; - }); - }, + _init: function() { + var self = this; + this.element.click(function(event) { + event.preventDefault(); + self._show(event.currentTarget); + return false; + }); + }, - _show: function(target) { - if ($(target).data("gallery_in_place_edit") == true) { - return; - } - $(target).data("gallery_in_place_edit", true); - var self = this; - var tag_width = $(target).width(); - $(self).data("tag_width", tag_width); + _show: function(target) { + if ($(target).data("gallery_in_place_edit") == true) { + return; + } + $(target).data("gallery_in_place_edit", true); + var self = this; + var tag_width = $(target).width(); + $(self).data("tag_width", tag_width); - var form = $("#g-in-place-edit-form"); - if (form.length > 0) { - self._cancel(); - } + var form = $("#g-in-place-edit-form"); + if (form.length > 0) { + self._cancel(); + } - $.get(self.options.form_url.replace("__ID__", $(target).attr('rel')), function(data) { - var parent = $(target).parent(); - parent.children().hide(); - parent.append(data); - self._setup_form(parent.find("form")); - }); - }, + $.get(self.options.form_url.replace("__ID__", $(target).attr('rel')), function(data) { + var parent = $(target).parent(); + parent.children().hide(); + parent.append(data); + self._setup_form(parent.find("form")); + }); + }, - _setup_form: function(form) { - var self = this; - var width = $(self).data("tag_width"); - form.find(":text").width(width).focus(); - form.find(".g-cancel").click(function(event) { - self._cancel(); - event.preventDefault(); - return false; - }); - $(".g-short-form").gallery_short_form(); - this._ajaxify_edit(); - }, + _setup_form: function(form) { + var self = this; + var width = $(self).data("tag_width"); + form.find(":text").width(width).focus(); + form.find(".g-cancel").click(function(event) { + self._cancel(); + event.preventDefault(); + return false; + }); + $(".g-short-form").gallery_short_form(); + this._ajaxify_edit(); + }, - _cancel: function() { - var parent = $("#g-in-place-edit-form").parent(); - $("#g-in-place-edit-form").remove(); - $(parent).children().show(); - $(parent).find(".g-editable").data("gallery_in_place_edit", false); - }, + _cancel: function() { + var parent = $("#g-in-place-edit-form").parent(); + $("#g-in-place-edit-form").remove(); + $(parent).children().show(); + $(parent).find(".g-editable").data("gallery_in_place_edit", false); + }, - _ajaxify_edit: function() { - var self = this; - var form = $("#g-in-place-edit-form"); - $(form).ajaxForm({ - dataType: "json", - success: function(data) { - if (data.result == "success") { - window.location.reload(); - } else { - var parent = $(form).parent(); - $(form).replaceWith(data.form); - self._setup_form(parent.find("form")); - } - } - }); - } - }); + _ajaxify_edit: function() { + var self = this; + var form = $("#g-in-place-edit-form"); + $(form).ajaxForm({ + dataType: "json", + success: function(data) { + if (data.result == "success") { + window.location.reload(); + } else { + var parent = $(form).parent(); + $(form).replaceWith(data.form); + self._setup_form(parent.find("form")); + } + } + }); + } + }); })(jQuery); -- cgit v1.2.3