git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@82 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2016-05-15 12:20:06 +00:00
parent 4c1e83cec1
commit 85c9f11b9f
19 changed files with 2266 additions and 67 deletions
+40 -6
View File
@@ -30,7 +30,23 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
},
events: {
"click #favoriteBtn": "favBtn",
"click #backBtn": "backBtn"
"click #backBtn": "backBtn",
"click #optionBtn": "optionBtn",
"click #copyBtn": "copyBtn"
},
copyBtn: function(e) {
e.preventDefault();
},
optionBtn: function(e) {
e.preventDefault();
var self = this;
self.$el.find('#optionPopupDialog').popup("open");
if(myManifest.Agent.browser.name == "Safari" || myManifest.Agent.browser.name == "Mobile Safari"){
var field = self.$el.find('#copyField');
field.val(window.location.href);
field[0].setSelectionRange(0, field[0].value.length);
}
},
backBtn: function (e) {
e.preventDefault();
@@ -51,6 +67,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
function (msg) {
var favBtn = self.$el.find('#favoriteBtn');
favBtn.addClass('ui-disabled');
self.$el.find('#optionPopupDialog').popup("close");
}
);
},
@@ -74,7 +91,8 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
self.galleryWall.fitWidth();
});
self.indexContent = 0;
self.switchContent();
$.mobile.loading('hide');
},
//render the content into div of view
@@ -149,7 +167,17 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
self.$arrayContent.on("swiperight", function (e) {
var index = jQuery.inArray(this, self.$arrayContent);
self.goToContent(index - 1);
});
});
if(myManifest.Agent.browser.name != "Safari" || myManifest.Agent.browser.name != "Mobile Safari"){
new Clipboard('#copyBtn', {
text: function(trigger) {
self.$el.find('#optionPopupDialog').popup("close");
return window.location.href;
}
});
}
self.trigger("renderCompleted:Item", self);
}
);
@@ -178,9 +206,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
this.$arrayContent.hide();
this.$arrayNavBar.removeClass('ui-btn-active');
this.$arrayNavBar.removeClass('ui-state-persist');
$(this.$arrayContent[this.indexContent]).show();
$(this.$arrayNavBar[this.indexContent]).addClass('ui-btn-active');
$(this.$arrayNavBar[this.indexContent]).addClass('ui-state-persist');
var content = $(this.$arrayContent[this.indexContent]);
if(content.css('min-height') == "0px" || content.css('min-height') == ""){
var minHeight = myManifest.Settings.Device.Height - $('[data-role="header"]').height() - $('[data-role="footer"]').height() - 37;
content.css('min-height', minHeight);
}
content.show();
var navBarItem = $(this.$arrayNavBar[this.indexContent]);
navBarItem.addClass('ui-btn-active');
navBarItem.addClass('ui-state-persist');
if(this.indexContent == 2)
this.galleryWall.fitWidth();
}