/[drupal]/contributions/modules/annotation/annotation_image/annotation_image.js
ViewVC logotype

Diff of /contributions/modules/annotation/annotation_image/annotation_image.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Thu Apr 30 23:05:29 2009 UTC revision 1.2, Fri May 1 02:27:17 2009 UTC
# Line 23  Drupal.behaviors.imageAnnotation = funct Line 23  Drupal.behaviors.imageAnnotation = funct
23    
24  Drupal.imageAnnotationOptions = {  Drupal.imageAnnotationOptions = {
25    preShow: function() {    preShow: function() {
26      $this = $(this);      var $this = $(this);
27      $canvas = $this.parents('.image-annotate-canvas');      var $canvas = $this.parents('.image-annotate-canvas');
28        $this.find('>div').hide();
29      $this.resizable({      $this.resizable({
30        handles: 'all',        handles: 'all',
31            resize: function(e, ui) {            resize: function(e, ui) {
# Line 49  Drupal.imageAnnotationOptions = { Line 50  Drupal.imageAnnotationOptions = {
50      })      })
51      .draggable({      .draggable({
52        containment: $canvas,        containment: $canvas,
53      });      })
54        .data('imageAnnotationOriginalPosition', $this.position());
55    },    },
56    submit: function() {    submit: function() {
57      $this = $(this);      var $this = $(this);
58      $('#edit-annotation-image-field', this.annotationForm).attr('value', $this.parents('.field-item').find('>a.image-annotate-add').attr('id').match(/[^-]*$/));      $('#edit-annotation-image-field', this.annotationForm).attr('value', $this.parents('.field-item').find('>a.image-annotate-add').attr('id').match(/[^-]*$/));
59      $('#edit-annotation-image-top', this.annotationForm).attr('value', $this.position().top);      $('#edit-annotation-image-top', this.annotationForm).attr('value', $this.position().top);
60      $('#edit-annotation-image-left', this.annotationForm).attr('value', $this.position().left);      $('#edit-annotation-image-left', this.annotationForm).attr('value', $this.position().left);
# Line 60  Drupal.imageAnnotationOptions = { Line 62  Drupal.imageAnnotationOptions = {
62      $('#edit-annotation-image-height', this.annotationForm).attr('value', $this.height());      $('#edit-annotation-image-height', this.annotationForm).attr('value', $this.height());
63    },    },
64    postHide: function() {    postHide: function() {
65      $(this).resizable('destroy')      var $this = $(this);
66        var position = $this.data('imageAnnotationOriginalPosition');
67        $this.resizable('destroy')
68      .draggable('destroy')      .draggable('destroy')
69      .css('height', '')      .css('height', '')
70      .css('width', '')      .css('width', '')
71      .css('left', '')      .css('left', position.left + 'px')
72      .css('top', '')      .css('top', position.top + 'px')
73      .parents('.image-annotate-edit').hide();      .parents('.image-annotate-edit').hide();
74        $this.find('>div').show();
75    }    }
76  };  };

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2