summaryrefslogtreecommitdiff
path: root/modules/book/book.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/book/book.js')
-rw-r--r--modules/book/book.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/book/book.js b/modules/book/book.js
new file mode 100644
index 000000000..74baffccf
--- /dev/null
+++ b/modules/book/book.js
@@ -0,0 +1,23 @@
+// $Id$
+
+(function($) {
+
+Drupal.behaviors.bookFieldsetSummaries = {
+ attach: function(context) {
+ $('fieldset#edit-book', context).setSummary(function(context) {
+ var val = $('#edit-book-bid').val();
+
+ if (val === '0') {
+ return Drupal.t('Not in book');
+ }
+ else if (val === 'new') {
+ return Drupal.t('New book');
+ }
+ else {
+ return Drupal.checkPlain($('#edit-book-bid :selected').text());
+ }
+ });
+ }
+};
+
+})(jQuery);