Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor shareLinkDialog into kind ShareLinkDialog

Add ShareLinkDialog kind and refactor Browser to use the
ShareLinkDialog kind instead of a generic AcceptCancelPopup.
  • Loading branch information...
commit 3bce1cdae2576c76030ee86f951d1fc310c7c80e 1 parent 285249b
andrew long authored
Showing with 17 additions and 10 deletions.
  1. +1 −0  depends.js
  2. +1 −10 source/Browser.js
  3. +15 −0 source/ShareLinkDialog.js
View
1  depends.js
@@ -34,6 +34,7 @@ enyo.depends(
"source/VerticalAcceptCancelPopup.js",
"source/BrowserPrompt.js",
"source/BookmarkDialog.js",
+ "source/ShareLinkDialog.js",
"source/NoFocusButton.js",
"source/clipboard.js",
"source/util.js",
View
11 source/Browser.js
@@ -86,14 +86,12 @@ enyo.kind({
{name: "promptMessage", className: "browser-dialog-body enyo-text-body "},
{name: "promptInput", kind: "Input", spellcheck: false, autocorrect: false, autoCapitalize: "lowercase"}
]},
+ {name: "shareLinkDialog", kind: "ShareLinkDialog"},
{name: "loginDialog", kind: "AcceptCancelPopup", onResponse: "loginResponse", onClose: "closeLogin", components: [
{name: "loginMessage", className: "browser-dialog-body enyo-text-body "},
{name: "userInput", kind: "Input", spellcheck: false, autocorrect: false, autoCapitalize: "lowercase", hint: $L("Username...")},
{name: "passwordInput", kind: "PasswordInput", hint: $L("Password...")}
]},
- {name: "shareLinkDialog", kind: "AcceptCancelPopup", onResponse: "shareLinkResponse", onClose: "closeShareLink", components: [
- {name: "shareMessage", className: "browser-dialog-body enyo-text-body "},
- ]},
{name: "sslDialog", kind: "Popup", onClose: "sslConfirmResponse", components: [
{name: "sslConfirmMessage", className: "browser-dialog-body enyo-text-body "},
{kind: enyo.HFlexBox, components: [
@@ -238,15 +236,11 @@ enyo.kind({
this.showPopup(this.$.promptDialog);
},
showShareLinkDialog: function(inSender, inUrl, inTitle) {
- this.$.shareLinkDialog.validateComponents();
this.showPopup(this.$.shareLinkDialog);
},
promptResponse: function(inAccept) {
this.sendDialogResponse(this, inAccept, this.$.promptInput.getValue() || this.$.promptInput.getHint());
},
- shareLinkResponse: function(inAccept) {
- this.log("response");
- },
closePrompt: function() {
this.$.promptInput.forceBlur();
},
@@ -316,9 +310,6 @@ enyo.kind({
this.$.userInput.forceBlur();
this.$.passwordInput.forceBlur();
},
- closeShareLink: function() {
- this.log("close share");
- },
openContextMenu: function(inSender, inEvent, inTapInfo) {
if (inTapInfo.isLink || inTapInfo.isImage) {
this.$.context.openAtTap(inEvent, inTapInfo);
View
15 source/ShareLinkDialog.js
@@ -0,0 +1,15 @@
+enyo.kind({
+ name: "ShareLinkDialog",
+ kind: "AcceptCancelPopup",
+ onResponse: "shareLinkResponse",
+ onClose: "closeShareLink",
+ components: [
+ {name: "shareMessage", className: "browser-dialog-body enyo-text-body "}
+ ],
+ shareLinkResponse: function(inAccept) {
+ this.log("response");
+ },
+ closeShareLink: function() {
+ this.log("close share");
+ }
+});
Please sign in to comment.
Something went wrong with that request. Please try again.