Tagger v2 20071023 1603 - Dragging enabled

git-svn-id: file:///home/shish/svn/shimmie2/trunk@563 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
Artanis
2007-10-23 23:03:41 +00:00
parent ae947698cd
commit c98f61496c
3 changed files with 35 additions and 4 deletions

View File

@ -22,6 +22,8 @@ function Tagger() {
// methods
this.initialize = initialize;
this.submit = submit;
this.getPosition = function () { return findPos(this.t_parent); };
this.setPosition = setPosition;
this.tagSearch = tagSearch;
this.searchRequest = searchRequest;
this.searchReceive = searchReceive;
@ -33,6 +35,7 @@ function Tagger() {
this.tagsToString = tagsToString;
this.toggleTag = toggleTag;
this.setAlert = setAlert;
// definitions
function initialize () {
@ -49,12 +52,38 @@ function Tagger() {
//this.buildPages();
// initial data
ajaxXML(query+"/"+image_id,tagListReceive);
// reveal
this.t_parent.style.display = "";
// dragging
DragHandler.attach(this.t_title);
// set position
// TODO: Apply cookie-based position saving
var pos = Tagger.getPosition();
setPosition(pos[0],pos[1]);
}
function submit() {
this.t_tags.value = Tagger.tagsToString(Tagger.appliedTags);
}
function setPosition(x,y) {
if(!x || !y) {
with(Tagger.t_parent.style) {
top = "25px";
left = "";
right = "25px";
bottom = "";
}
var pos = Tagger.getPosition();
x = pos[0];
y = pos[1];
}
with(Tagger.t_parent.style) {
top = y+"px";
left = x+"px";
right="";
bottom="";
}
}
function tagSearch(s,ms) {
clearTimeout(tagger_filter_timer);
tagger_filter_timer = setTimeout("Tagger.searchRequest('"+s+"')",ms);