aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-03-29 15:40:26 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-03-29 15:40:26 +0300
commitbcba82bbbcc55a511de1e126e0741ea6cf9fb505 (patch)
tree7af10da128b3989ae6672dd0a6dd94eee1ed6d75 /src
parent7fd2ee051cb541eac73901c1f67052219fc25584 (diff)
downloadDevHive-Angular-bcba82bbbcc55a511de1e126e0741ea6cf9fb505.tar
DevHive-Angular-bcba82bbbcc55a511de1e126e0741ea6cf9fb505.tar.gz
DevHive-Angular-bcba82bbbcc55a511de1e126e0741ea6cf9fb505.zip
Added logic for transferring languages and technologies from available to chosen and back in profile settings
Diffstat (limited to 'src')
-rw-r--r--src/app/components/profile-settings/profile-settings.component.ts27
-rw-r--r--src/styles.css4
2 files changed, 28 insertions, 3 deletions
diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts
index 4bee52e..4724f02 100644
--- a/src/app/components/profile-settings/profile-settings.component.ts
+++ b/src/app/components/profile-settings/profile-settings.component.ts
@@ -274,13 +274,34 @@ export class ProfileSettingsComponent implements OnInit {
}
langClick(name: string): void {
- console.log('Language: ' + name);
+ if (this.chosenLanguages.some(c => c.name === name)) {
+ const index = this.chosenLanguages.findIndex(t => t.name === name);
+
+ this.availableLanguages.push(this.chosenLanguages[index]);
+ this.chosenLanguages.splice(index, 1);
+ }
+ else {
+ const index = this.availableLanguages.findIndex(t => t.name === name);
+
+ this.chosenLanguages.push(this.availableLanguages[index]);
+ this.availableLanguages.splice(index, 1);
+ }
}
techClick(name: string): void {
- console.log('Technology: ' + name);
- }
+ if (this.chosenTechnologies.some(c => c.name === name)) {
+ const index = this.chosenTechnologies.findIndex(t => t.name === name);
+ this.availableTechnologies.push(this.chosenTechnologies[index]);
+ this.chosenTechnologies.splice(index, 1);
+ }
+ else {
+ const index = this.availableTechnologies.findIndex(t => t.name === name);
+
+ this.chosenTechnologies.push(this.availableTechnologies[index]);
+ this.availableTechnologies.splice(index, 1);
+ }
+ }
goToProfile(): void {
this._router.navigate([this._router.url.substring(0, this._router.url.length - 9)]);
diff --git a/src/styles.css b/src/styles.css
index 39b6fb1..c9a4f25 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -279,6 +279,10 @@ input[type=file]::file-selector-button {
padding: 0.1em;
}
+.padding-right-1 {
+ padding-right: 1em !important;
+}
+
.padding-right-1dot5 {
padding-right: 1.5em !important;
}